summaryrefslogtreecommitdiffstats
path: root/Http/Tests/HttpUtilsTest.php
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2016-12-19 17:13:57 +0100
committerFabien Potencier <fabien.potencier@gmail.com>2016-12-19 17:13:57 +0100
commit9ba5cbed388bbf235d6ba2e2211134ff5514960f (patch)
tree669494c864e907ed8c1f286dd049c11739b93472 /Http/Tests/HttpUtilsTest.php
parent3b5625de42114cd121282bdfc4879a28e85d64ec (diff)
parent7a9b11f3428243d368690b9485098e2d531703e7 (diff)
downloadsymfony-security-9ba5cbed388bbf235d6ba2e2211134ff5514960f.zip
symfony-security-9ba5cbed388bbf235d6ba2e2211134ff5514960f.tar.gz
symfony-security-9ba5cbed388bbf235d6ba2e2211134ff5514960f.tar.bz2
Merge branch '3.2'
* 3.2: fixed obsolete getMock() usage fixed obsolete getMock() usage fixed obsolete getMock() usage fixed obsolete getMock() usage [WebProfilerBundle] Display multiple HTTP headers in WDT do not remove the Twig ExceptionController service removed obsolete condition do not try to register incomplete definitions
Diffstat (limited to 'Http/Tests/HttpUtilsTest.php')
-rw-r--r--Http/Tests/HttpUtilsTest.php24
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')