Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ae283e8

Browse files
committed
[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.
1 parent 8b8e7bb commit ae283e8

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ public function testSearchResult()
110110
->method('find')
111111
->will($this->returnValue($tokens));
112112

113+
$request = Request::create('/_profiler/empty/search/results', 'GET', array(
114+
'limit' => 2,
115+
'ip' => '127.0.0.1',
116+
'method' => 'GET',
117+
'url' => 'http://example.com/',
118+
));
119+
113120
$twig->expects($this->once())
114121
->method('render')
115122
->with($this->stringEndsWith('results.html.twig'), $this->equalTo(array(
@@ -123,16 +130,10 @@ public function testSearchResult()
123130
'end' => null,
124131
'limit' => 2,
125132
'panel' => null,
133+
'request' => $request,
126134
)));
127135

128-
$response = $controller->searchResultsAction(
129-
Request::create(
130-
'/_profiler/empty/search/results',
131-
'GET',
132-
array('limit' => 2, 'ip' => '127.0.0.1', 'method' => 'GET', 'url' => 'http://example.com/')
133-
),
134-
'empty'
135-
);
136+
$response = $controller->searchResultsAction($request, 'empty');
136137
$this->assertEquals(200, $response->getStatusCode());
137138
}
138139
}

0 commit comments

Comments
 (0)