Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 764722d

Browse filesBrowse files
committed
Fixing bad mock of "abstract" class
1 parent 298fe36 commit 764722d
Copy full SHA for 764722d

File tree

Expand file treeCollapse file tree

1 file changed

+9
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/Tests/Loader/ServiceRouterLoaderTest.php
+9-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.