Skip to content

Commit

Permalink
Merge branch '7.1' into 7.2
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
xabbuh committed Oct 22, 2024
2 parents edbb1d0 + af38cce commit d748fcb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion AbstractBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ public function reload(): Crawler
*/
public function followRedirect(): Crawler
{
if (!$this->redirect) {
if (!isset($this->redirect)) {
throw new LogicException('The request was not redirected.');
}

Expand Down
11 changes: 11 additions & 0 deletions Tests/AbstractBrowserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\BrowserKit\CookieJar;
use Symfony\Component\BrowserKit\Exception\BadMethodCallException;
use Symfony\Component\BrowserKit\Exception\InvalidArgumentException;
use Symfony\Component\BrowserKit\Exception\LogicException;
use Symfony\Component\BrowserKit\History;
use Symfony\Component\BrowserKit\Request;
use Symfony\Component\BrowserKit\Response;
Expand Down Expand Up @@ -889,4 +890,14 @@ public function testInternalRequestNull()

$client->getInternalRequest();
}

public function testFollowRedirectWithoutRequest()
{
$browser = $this->getBrowser();

$this->expectException(LogicException::class);
$this->expectExceptionMessage('The request was not redirected.');

$browser->followRedirect();
}
}

0 comments on commit d748fcb

Please sign in to comment.