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;
}