protected function KernelTest::getBundle

17 calls to KernelTest::getBundle()
KernelTest::testInitializeBundles in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php
KernelTest::testInitializeBundlesSupportInheritanceCascade in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php
KernelTest::testInitializeBundlesSupportsArbitraryBundleRegistrationOrder in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php
KernelTest::testInitializeBundlesThrowsExceptionWhenABundleIsDirectlyExtendedByTwoBundles in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php
@expectedException \LogicException
KernelTest::testInitializeBundlesThrowsExceptionWhenAParentDoesNotExists in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php
@expectedException \LogicException

... See full list

File

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

Class

KernelTest

Namespace

Symfony\Component\HttpKernel\Tests

Code

protected function getBundle($dir = null, $parent = null, $className = null, $bundleName = null) {
  $bundle = $this
    ->getMockBuilder('Symfony\\Component\\HttpKernel\\Bundle\\BundleInterface')
    ->setMethods(array(
    'getPath',
    'getParent',
    'getName',
  ))
    ->disableOriginalConstructor();
  if ($className) {
    $bundle
      ->setMockClassName($className);
  }
  $bundle = $bundle
    ->getMockForAbstractClass();
  $bundle
    ->expects($this
    ->any())
    ->method('getName')
    ->will($this
    ->returnValue(null === $bundleName ? get_class($bundle) : $bundleName));
  $bundle
    ->expects($this
    ->any())
    ->method('getPath')
    ->will($this
    ->returnValue($dir));
  $bundle
    ->expects($this
    ->any())
    ->method('getParent')
    ->will($this
    ->returnValue($parent));
  return $bundle;
}