Skip to content

Commit 764722d

Browse files
committed
Fixing bad mock of "abstract" class
1 parent 298fe36 commit 764722d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Symfony/Component/Routing/Tests/Loader/ServiceRouterLoaderTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function testLoadCallsServiceAndReturnsCollection()
2121
{
2222
$routeLoader = $this->getMock('Symfony\Component\Routing\Loader\RouteLoaderInterface');
2323

24-
$container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface', array('get'));
24+
$container = $this->getMockedContainer();
2525

2626
$container
2727
->expects($this->any())
@@ -58,7 +58,7 @@ public function testExceptionOnInterfaceNotImplemented()
5858
// anything that doesn't implement the interface
5959
$routeLoader = new \stdClass();
6060

61-
$container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface', array('get'));
61+
$container = $this->getMockedContainer();
6262

6363
$container
6464
->expects($this->once())
@@ -69,4 +69,11 @@ public function testExceptionOnInterfaceNotImplemented()
6969
$serviceRouteLoader = new ServiceRouterLoader($container);
7070
$serviceRouteLoader->load('any_service_name', 'service');
7171
}
72+
73+
private function getMockedContainer()
74+
{
75+
return $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\ContainerInterface')
76+
//->setMethods(array('get'))
77+
->getMockForAbstractClass();
78+
}
7279
}

0 commit comments

Comments
 (0)