You are here

public function KernelTest::testInitializeBundlesSupportsArbitraryBundleRegistrationOrder in Zircon Profile 8.0

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

File

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

Class

KernelTest

Namespace

Symfony\Component\HttpKernel\Tests

Code

public function testInitializeBundlesSupportsArbitraryBundleRegistrationOrder() {
  $grandparent = $this
    ->getBundle(null, null, 'GrandParentCBundle');
  $parent = $this
    ->getBundle(null, 'GrandParentCBundle', 'ParentCBundle');
  $child = $this
    ->getBundle(null, 'ParentCBundle', 'ChildCBundle');

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