Skip to content

Commit d748fcb

Browse files
committed
Merge branch '7.1' into 7.2
* 7.1: do not access typed property before initialization do not access typed properties before initialization Fix typo in deprecation message Symfony 5.4 LTS will get security fixes until Feb 2029 thanks to Ibexa' sponsoring Fix #53037
2 parents edbb1d0 + af38cce commit d748fcb

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

AbstractBrowser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ public function reload(): Crawler
554554
*/
555555
public function followRedirect(): Crawler
556556
{
557-
if (!$this->redirect) {
557+
if (!isset($this->redirect)) {
558558
throw new LogicException('The request was not redirected.');
559559
}
560560

Tests/AbstractBrowserTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\BrowserKit\CookieJar;
1616
use Symfony\Component\BrowserKit\Exception\BadMethodCallException;
1717
use Symfony\Component\BrowserKit\Exception\InvalidArgumentException;
18+
use Symfony\Component\BrowserKit\Exception\LogicException;
1819
use Symfony\Component\BrowserKit\History;
1920
use Symfony\Component\BrowserKit\Request;
2021
use Symfony\Component\BrowserKit\Response;
@@ -889,4 +890,14 @@ public function testInternalRequestNull()
889890

890891
$client->getInternalRequest();
891892
}
893+
894+
public function testFollowRedirectWithoutRequest()
895+
{
896+
$browser = $this->getBrowser();
897+
898+
$this->expectException(LogicException::class);
899+
$this->expectExceptionMessage('The request was not redirected.');
900+
901+
$browser->followRedirect();
902+
}
892903
}

0 commit comments

Comments
 (0)