You are here

public function StaticMenuLinkOverridesTest::testLoadMultipleOverrides in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php \Drupal\Tests\Core\Menu\StaticMenuLinkOverridesTest::testLoadMultipleOverrides()

Tests the loadMultipleOverrides method.

@covers ::loadMultipleOverrides @covers ::getConfig

File

core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php, line 85
Contains \Drupal\Tests\Core\Menu\StaticMenuLinkOverridesTest.

Class

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

Namespace

Drupal\Tests\Core\Menu

Code

public function testLoadMultipleOverrides() {
  $overrides = array();
  $overrides['test1'] = array(
    'parent' => 'test0',
  );
  $overrides['test2'] = array(
    'parent' => 'test1',
  );
  $overrides['test1__la___ma'] = array(
    'parent' => 'test2',
  );
  $config_factory = $this
    ->getConfigFactoryStub(array(
    'core.menu.static_menu_link_overrides' => array(
      'definitions' => $overrides,
    ),
  ));
  $static_override = new StaticMenuLinkOverrides($config_factory);
  $this
    ->assertEquals(array(
    'test1' => array(
      'parent' => 'test0',
    ),
    'test1.la__ma' => array(
      'parent' => 'test2',
    ),
  ), $static_override
    ->loadMultipleOverrides(array(
    'test1',
    'test1.la__ma',
  )));
}