Skip to content

Commit 61a2321

Browse files
committed
Throw exception when seeRedirectTo can't work
1 parent 5374f49 commit 61a2321

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Module/Nette.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public function grabService($service)
6464

6565
public function seeRedirectTo($url)
6666
{
67+
if ($this->config['followRedirects']) {
68+
$this->fail('Method seeRedirectTo only works when followRedirects option is disabled');
69+
}
6770
$request = $this->container->getByType('Nette\Http\IRequest');
6871
$response = $this->container->getByType('Nette\Http\IResponse');
6972
if ($response->getHeader('Location') !== $request->getUrl()->getHostUrl() . $url && $response->getHeader('Location') !== $url) {

0 commit comments

Comments
 (0)