From ae283e80d10184b4f598c8810a61cf1d8e78e238 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 28 Sep 2015 20:15:56 +0200 Subject: [PATCH] [WebProfilerBundle] reflect latest changes in test In #15973, the `searchResultsAction()` of the `ProfilerController` was updated to pass the current request to the rendered template. However, this change was not reflected in the test thus letting it fail. --- .../Tests/Controller/ProfilerControllerTest.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php b/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php index 4a290ad514..f8cec7a9c8 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php @@ -110,6 +110,13 @@ class ProfilerControllerTest extends \PHPUnit_Framework_TestCase ->method('find') ->will($this->returnValue($tokens)); + $request = Request::create('/_profiler/empty/search/results', 'GET', array( + 'limit' => 2, + 'ip' => '127.0.0.1', + 'method' => 'GET', + 'url' => 'http://example.com/', + )); + $twig->expects($this->once()) ->method('render') ->with($this->stringEndsWith('results.html.twig'), $this->equalTo(array( @@ -123,16 +130,10 @@ class ProfilerControllerTest extends \PHPUnit_Framework_TestCase 'end' => null, 'limit' => 2, 'panel' => null, + 'request' => $request, ))); - $response = $controller->searchResultsAction( - Request::create( - '/_profiler/empty/search/results', - 'GET', - array('limit' => 2, 'ip' => '127.0.0.1', 'method' => 'GET', 'url' => 'http://example.com/') - ), - 'empty' - ); + $response = $controller->searchResultsAction($request, 'empty'); $this->assertEquals(200, $response->getStatusCode()); } }