@@ 226-240 (lines=15) @@ | ||
223 | /** |
|
224 | * @test |
|
225 | */ |
|
226 | public function shouldUseDefaultCodeWhenRedirectingToRoute() |
|
227 | { |
|
228 | $this->urlGenerator->expects($this->once())->method('generate')->with( |
|
229 | $this->equalTo('some_route'), |
|
230 | $this->equalTo(['foo' => 'bar']), |
|
231 | $this->equalTo(UrlGeneratorInterface::ABSOLUTE_URL) |
|
232 | )->willReturn("*this-is-some-url*"); |
|
233 | ||
234 | $expectedResponse = new RedirectResponse("*this-is-some-url*", 301); |
|
235 | ||
236 | /** @var RedirectResponse $actualResponse */ |
|
237 | $actualResponse = $this->controllerHelper->redirectToRoute("some_route", ['foo' => 'bar']); |
|
238 | ||
239 | $this->assertEquals($expectedResponse, $actualResponse); |
|
240 | } |
|
241 | ||
242 | /** |
|
243 | * @test |
|
@@ 245-259 (lines=15) @@ | ||
242 | /** |
|
243 | * @test |
|
244 | */ |
|
245 | public function shouldRedirectToRoute() |
|
246 | { |
|
247 | $this->urlGenerator->expects($this->once())->method('generate')->with( |
|
248 | $this->equalTo('some_route'), |
|
249 | $this->equalTo(['foo' => 'bar']), |
|
250 | $this->equalTo(UrlGeneratorInterface::ABSOLUTE_URL) |
|
251 | )->willReturn("*this-is-some-url*"); |
|
252 | ||
253 | $expectedResponse = new RedirectResponse("*this-is-some-url*", 302); |
|
254 | ||
255 | /** @var RedirectResponse $actualResponse */ |
|
256 | $actualResponse = $this->controllerHelper->redirectToRoute("some_route", ['foo' => 'bar'], 302); |
|
257 | ||
258 | $this->assertEquals($expectedResponse, $actualResponse); |
|
259 | } |
|
260 | ||
261 | /** |
|
262 | * @test |