diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2016-12-19 10:02:29 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2016-12-19 16:22:46 +0100 |
commit | 0582ad240b9aa4b86945b3fdee0f84b20eb0856f (patch) | |
tree | e2eff67cc198e382599df30992fc598c433b9b6e /Http/Tests/HttpUtilsTest.php | |
parent | e396644d91c69dd7844f83735832e896e6ed4bf3 (diff) | |
download | symfony-security-0582ad240b9aa4b86945b3fdee0f84b20eb0856f.zip symfony-security-0582ad240b9aa4b86945b3fdee0f84b20eb0856f.tar.gz symfony-security-0582ad240b9aa4b86945b3fdee0f84b20eb0856f.tar.bz2 |
fixed obsolete getMock() usage
Diffstat (limited to 'Http/Tests/HttpUtilsTest.php')
-rw-r--r-- | Http/Tests/HttpUtilsTest.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Http/Tests/HttpUtilsTest.php b/Http/Tests/HttpUtilsTest.php index 45a0281..bb432a0 100644 --- a/Http/Tests/HttpUtilsTest.php +++ b/Http/Tests/HttpUtilsTest.php @@ -39,7 +39,7 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase public function testCreateRedirectResponseWithRouteName() { - $utils = new HttpUtils($urlGenerator = $this->getMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface')); + $utils = new HttpUtils($urlGenerator = $this->getMockBuilder('Symfony\Component\Routing\Generator\UrlGeneratorInterface')->getMock()); $urlGenerator ->expects($this->any()) @@ -50,7 +50,7 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase $urlGenerator ->expects($this->any()) ->method('getContext') - ->will($this->returnValue($this->getMock('Symfony\Component\Routing\RequestContext'))) + ->will($this->returnValue($this->getMockBuilder('Symfony\Component\Routing\RequestContext')->getMock())) ; $response = $utils->createRedirectResponse($this->getRequest(), 'foobar'); @@ -73,7 +73,7 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase public function testCreateRequestWithRouteName() { - $utils = new HttpUtils($urlGenerator = $this->getMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface')); + $utils = new HttpUtils($urlGenerator = $this->getMockBuilder('Symfony\Component\Routing\Generator\UrlGeneratorInterface')->getMock()); $urlGenerator ->expects($this->once()) @@ -83,7 +83,7 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase $urlGenerator ->expects($this->any()) ->method('getContext') - ->will($this->returnValue($this->getMock('Symfony\Component\Routing\RequestContext'))) + ->will($this->returnValue($this->getMockBuilder('Symfony\Component\Routing\RequestContext')->getMock())) ; $subRequest = $utils->createRequest($this->getRequest(), 'foobar'); @@ -93,7 +93,7 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase public function testCreateRequestWithAbsoluteUrl() { - $utils = new HttpUtils($this->getMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface')); + $utils = new HttpUtils($this->getMockBuilder('Symfony\Component\Routing\Generator\UrlGeneratorInterface')->getMock()); $subRequest = $utils->createRequest($this->getRequest(), 'http://symfony.com/'); $this->assertEquals('/', $subRequest->getPathInfo()); @@ -102,7 +102,7 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase public function testCreateRequestPassesSessionToTheNewRequest() { $request = $this->getRequest(); - $request->setSession($session = $this->getMock('Symfony\Component\HttpFoundation\Session\SessionInterface')); + $request->setSession($session = $this->getMockBuilder('Symfony\Component\HttpFoundation\Session\SessionInterface')->getMock()); $utils = new HttpUtils($this->getUrlGenerator()); $subRequest = $utils->createRequest($request, '/foobar'); @@ -148,7 +148,7 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase public function testCheckRequestPathWithUrlMatcherAndResourceNotFound() { - $urlMatcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface'); + $urlMatcher = $this->getMockBuilder('Symfony\Component\Routing\Matcher\UrlMatcherInterface')->getMock(); $urlMatcher ->expects($this->any()) ->method('match') @@ -163,7 +163,7 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase public function testCheckRequestPathWithUrlMatcherAndMethodNotAllowed() { $request = $this->getRequest(); - $urlMatcher = $this->getMock('Symfony\Component\Routing\Matcher\RequestMatcherInterface'); + $urlMatcher = $this->getMockBuilder('Symfony\Component\Routing\Matcher\RequestMatcherInterface')->getMock(); $urlMatcher ->expects($this->any()) ->method('matchRequest') @@ -177,7 +177,7 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase public function testCheckRequestPathWithUrlMatcherAndResourceFoundByUrl() { - $urlMatcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface'); + $urlMatcher = $this->getMockBuilder('Symfony\Component\Routing\Matcher\UrlMatcherInterface')->getMock(); $urlMatcher ->expects($this->any()) ->method('match') @@ -192,7 +192,7 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase public function testCheckRequestPathWithUrlMatcherAndResourceFoundByRequest() { $request = $this->getRequest(); - $urlMatcher = $this->getMock('Symfony\Component\Routing\Matcher\RequestMatcherInterface'); + $urlMatcher = $this->getMockBuilder('Symfony\Component\Routing\Matcher\RequestMatcherInterface')->getMock(); $urlMatcher ->expects($this->any()) ->method('matchRequest') @@ -209,7 +209,7 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase */ public function testCheckRequestPathWithUrlMatcherLoadingException() { - $urlMatcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface'); + $urlMatcher = $this->getMockBuilder('Symfony\Component\Routing\Matcher\UrlMatcherInterface')->getMock(); $urlMatcher ->expects($this->any()) ->method('match') @@ -250,7 +250,7 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase private function getUrlGenerator($generatedUrl = '/foo/bar') { - $urlGenerator = $this->getMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface'); + $urlGenerator = $this->getMockBuilder('Symfony\Component\Routing\Generator\UrlGeneratorInterface')->getMock(); $urlGenerator ->expects($this->any()) ->method('generate') |