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

Skip to content

Commit 0d71b1e

Browse files
committed
minor #15981 [WebProfilerBundle] reflect latest changes in test (xabbuh)
This PR was merged into the 2.8 branch. Discussion ---------- [WebProfilerBundle] reflect latest changes in test | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | 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. Commits ------- ae283e8 [WebProfilerBundle] reflect latest changes in test
2 parents 8b8e7bb + ae283e8 commit 0d71b1e

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)