You are here

public function KernelTest::testInitializeBundlesSupportInheritanceCascade in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Tests/KernelTest.php \Symfony\Component\HttpKernel\Tests\KernelTest::testInitializeBundlesSupportInheritanceCascade()

File

vendor/symfony/http-kernel/Tests/KernelTest.php, line 629

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');

  // use test kernel so we can access getBundleMap()
  $kernel = $this
    ->getKernelForTest(array(
    'registerBundles',
  ));
  $kernel
    ->expects($this
    ->once())
    ->method('registerBundles')
    ->will($this
    ->returnValue(array(
    $grandparent,
    $parent,
    $child,
  )));
  $kernel
    ->boot();
  $map = $kernel
    ->getBundleMap();
  $this
    ->assertEquals(array(
    $child,
    $parent,
    $grandparent,
  ), $map['GrandParentBBundle']);
  $this
    ->assertEquals(array(
    $child,
    $parent,
  ), $map['ParentBBundle']);
  $this
    ->assertEquals(array(
    $child,
  ), $map['ChildBBundle']);
}