Skip to content

Commit a8c4f05

Browse files
committed
fixed obsolete getMock() usage
1 parent aa5c9a9 commit a8c4f05

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Tests/Generator/UrlGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function testGenerateForRouteWithInvalidOptionalParameterNonStrict()
208208
public function testGenerateForRouteWithInvalidOptionalParameterNonStrictWithLogger()
209209
{
210210
$routes = $this->getRoutes('test', new Route('/testing/{foo}', array('foo' => '1'), array('foo' => 'd+')));
211-
$logger = $this->getMock('Psr\Log\LoggerInterface');
211+
$logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
212212
$logger->expects($this->once())
213213
->method('error');
214214
$generator = $this->getGenerator($routes, array(), $logger);

Tests/Loader/PhpFileLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase
1818
{
1919
public function testSupports()
2020
{
21-
$loader = new PhpFileLoader($this->getMock('Symfony\Component\Config\FileLocator'));
21+
$loader = new PhpFileLoader($this->getMockBuilder('Symfony\Component\Config\FileLocator')->getMock());
2222

2323
$this->assertTrue($loader->supports('foo.php'), '->supports() returns true if the resource is loadable');
2424
$this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable');

Tests/Loader/XmlFileLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
1919
{
2020
public function testSupports()
2121
{
22-
$loader = new XmlFileLoader($this->getMock('Symfony\Component\Config\FileLocator'));
22+
$loader = new XmlFileLoader($this->getMockBuilder('Symfony\Component\Config\FileLocator')->getMock());
2323

2424
$this->assertTrue($loader->supports('foo.xml'), '->supports() returns true if the resource is loadable');
2525
$this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable');

Tests/Loader/YamlFileLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase
1919
{
2020
public function testSupports()
2121
{
22-
$loader = new YamlFileLoader($this->getMock('Symfony\Component\Config\FileLocator'));
22+
$loader = new YamlFileLoader($this->getMockBuilder('Symfony\Component\Config\FileLocator')->getMock());
2323

2424
$this->assertTrue($loader->supports('foo.yml'), '->supports() returns true if the resource is loadable');
2525
$this->assertTrue($loader->supports('foo.yaml'), '->supports() returns true if the resource is loadable');

Tests/RouterTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase
2222

2323
protected function setUp()
2424
{
25-
$this->loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
25+
$this->loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock();
2626
$this->router = new Router($this->loader, 'routing.yml');
2727
}
2828

@@ -82,7 +82,7 @@ public function testThatRouteCollectionIsLoaded()
8282
{
8383
$this->router->setOption('resource_type', 'ResourceType');
8484

85-
$routeCollection = $this->getMock('Symfony\Component\Routing\RouteCollection');
85+
$routeCollection = $this->getMockBuilder('Symfony\Component\Routing\RouteCollection')->getMock();
8686

8787
$this->loader->expects($this->once())
8888
->method('load')->with('routing.yml', 'ResourceType')
@@ -100,7 +100,7 @@ public function testMatcherIsCreatedIfCacheIsNotConfigured($option)
100100

101101
$this->loader->expects($this->once())
102102
->method('load')->with('routing.yml', null)
103-
->will($this->returnValue($this->getMock('Symfony\Component\Routing\RouteCollection')));
103+
->will($this->returnValue($this->getMockBuilder('Symfony\Component\Routing\RouteCollection')->getMock()));
104104

105105
$this->assertInstanceOf('Symfony\\Component\\Routing\\Matcher\\UrlMatcher', $this->router->getMatcher());
106106
}
@@ -122,7 +122,7 @@ public function testGeneratorIsCreatedIfCacheIsNotConfigured($option)
122122

123123
$this->loader->expects($this->once())
124124
->method('load')->with('routing.yml', null)
125-
->will($this->returnValue($this->getMock('Symfony\Component\Routing\RouteCollection')));
125+
->will($this->returnValue($this->getMockBuilder('Symfony\Component\Routing\RouteCollection')->getMock()));
126126

127127
$this->assertInstanceOf('Symfony\\Component\\Routing\\Generator\\UrlGenerator', $this->router->getGenerator());
128128
}
@@ -137,7 +137,7 @@ public function provideGeneratorOptionsPreventingCaching()
137137

138138
public function testMatchRequestWithUrlMatcherInterface()
139139
{
140-
$matcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface');
140+
$matcher = $this->getMockBuilder('Symfony\Component\Routing\Matcher\UrlMatcherInterface')->getMock();
141141
$matcher->expects($this->once())->method('match');
142142

143143
$p = new \ReflectionProperty($this->router, 'matcher');
@@ -149,7 +149,7 @@ public function testMatchRequestWithUrlMatcherInterface()
149149

150150
public function testMatchRequestWithRequestMatcherInterface()
151151
{
152-
$matcher = $this->getMock('Symfony\Component\Routing\Matcher\RequestMatcherInterface');
152+
$matcher = $this->getMockBuilder('Symfony\Component\Routing\Matcher\RequestMatcherInterface')->getMock();
153153
$matcher->expects($this->once())->method('matchRequest');
154154

155155
$p = new \ReflectionProperty($this->router, 'matcher');

0 commit comments

Comments
 (0)