function StaticMenuLinkOverridesTest::testLoadOverride

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

Tests the loadOverride method.

@dataProvider providerTestLoadOverride

@covers ::loadOverride @covers ::getConfig

File

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

Class

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

Namespace

Drupal\Tests\Core\Menu

Code

public function testLoadOverride($overrides, $id, $expected) : void {
    $config_factory = $this->getConfigFactoryStub([
        'core.menu.static_menu_link_overrides' => [
            'definitions' => $overrides,
        ],
    ]);
    $static_override = new StaticMenuLinkOverrides($config_factory);
    $this->assertEquals($expected, $static_override->loadOverride($id));
}

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