public function KernelTest::testInitializeBundlesSupportInheritanceCascade

File

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

Class

KernelTest

Namespace

Symfony\Component\HttpKernel\Tests

Code

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