function StaticMenuLinkOverridesTest::providerTestLoadOverride

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php \Drupal\Tests\Core\Menu\StaticMenuLinkOverridesTest::providerTestLoadOverride()
  2. 10 core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php \Drupal\Tests\Core\Menu\StaticMenuLinkOverridesTest::providerTestLoadOverride()
  3. 11.x core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php \Drupal\Tests\Core\Menu\StaticMenuLinkOverridesTest::providerTestLoadOverride()

Provides test data for testLoadOverride.

File

core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php, line 48

Class

StaticMenuLinkOverridesTest
@coversDefaultClass \Drupal\Core\Menu\StaticMenuLinkOverrides @group Menu

Namespace

Drupal\Tests\Core\Menu

Code

public function providerTestLoadOverride() {
    $data = [];
    // Valid ID.
    $data[] = [
        [
            'test1' => [
                'parent' => 'test0',
            ],
        ],
        'test1',
        [
            'parent' => 'test0',
        ],
    ];
    // Non existing ID.
    $data[] = [
        [
            'test1' => [
                'parent' => 'test0',
            ],
        ],
        'test2',
        [],
    ];
    // Ensure that the ID is encoded properly
    $data[] = [
        [
            'test1__la___ma' => [
                'parent' => 'test0',
            ],
        ],
        'test1.la__ma',
        [
            'parent' => 'test0',
        ],
    ];
    return $data;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.