public function KernelTest::testInitializeBundlesSupportsArbitraryBundleRegistrationOrder

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php, line 599

Class

KernelTest

Namespace

Symfony\Component\HttpKernel\Tests

Code

public function testInitializeBundlesSupportsArbitraryBundleRegistrationOrder() {
  $grandparent = $this
    ->getBundle(null, null, 'GrandParentCCundle');
  $parent = $this
    ->getBundle(null, 'GrandParentCCundle', 'ParentCCundle');
  $child = $this
    ->getBundle(null, 'ParentCCundle', 'ChildCCundle');
  $kernel = $this
    ->getKernel();
  $kernel
    ->expects($this
    ->once())
    ->method('registerBundles')
    ->will($this
    ->returnValue(array(
    $parent,
    $grandparent,
    $child,
  )));
  $kernel
    ->initializeBundles();
  $map = $kernel
    ->getBundleMap();
  $this
    ->assertEquals(array(
    $child,
    $parent,
    $grandparent,
  ), $map['GrandParentCCundle']);
  $this
    ->assertEquals(array(
    $child,
    $parent,
  ), $map['ParentCCundle']);
  $this
    ->assertEquals(array(
    $child,
  ), $map['ChildCCundle']);
}