protected function KernelTest::getBundle in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-kernel/Tests/KernelTest.php \Symfony\Component\HttpKernel\Tests\KernelTest::getBundle()
Returns a mock for the BundleInterface.
Return value
17 calls to KernelTest::getBundle()
- KernelTest::testInitializeBundles in vendor/
symfony/ http-kernel/ Tests/ KernelTest.php - KernelTest::testInitializeBundlesSupportInheritanceCascade in vendor/
symfony/ http-kernel/ Tests/ KernelTest.php - KernelTest::testInitializeBundlesSupportsArbitraryBundleRegistrationOrder in vendor/
symfony/ http-kernel/ Tests/ KernelTest.php - KernelTest::testInitializeBundlesThrowsExceptionWhenABundleIsDirectlyExtendedByTwoBundles in vendor/
symfony/ http-kernel/ Tests/ KernelTest.php - @expectedException \LogicException @expectedExceptionMessage Bundle "ParentCBundle" is directly extended by two bundles "ChildC2Bundle" and "ChildC1Bundle".
- KernelTest::testInitializeBundlesThrowsExceptionWhenAParentDoesNotExists in vendor/
symfony/ http-kernel/ Tests/ KernelTest.php - @expectedException \LogicException @expectedExceptionMessage Bundle "ChildCBundle" extends bundle "FooBar", which is not registered.
File
- vendor/
symfony/ http-kernel/ Tests/ KernelTest.php, line 773
Class
Namespace
Symfony\Component\HttpKernel\TestsCode
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;
}