From ef5f11f3abd470274a8e28750e73c76e9654290e Mon Sep 17 00:00:00 2001 From: Aaron Gustavo Nieves Date: Fri, 26 Jun 2026 17:33:58 -0500 Subject: [PATCH] Verify assertBrowserHistoryIsNotOnLastPage is unavailable (5.4) On Symfony 5.4 (symfony/browser-kit < 7.4) the BrowserHistory constraint does not exist, so the assertion from module-symfony#240 is not available and the step fails with a descriptive "requires symfony/browser-kit >= 7.4" message. This locks in that documented behaviour for the lower-version branches. --- tests/Functional/BrowserCest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/Functional/BrowserCest.php b/tests/Functional/BrowserCest.php index 7167bac..ed8d405 100644 --- a/tests/Functional/BrowserCest.php +++ b/tests/Functional/BrowserCest.php @@ -6,6 +6,7 @@ use App\Entity\User; use App\Tests\Support\FunctionalTester; +use PHPUnit\Framework\ExpectationFailedException; final class BrowserCest { @@ -28,6 +29,18 @@ public function assertBrowserNotHasCookie(FunctionalTester $I) $I->assertBrowserNotHasCookie('TESTCOOKIE'); } + public function assertBrowserHistoryIsNotOnLastPageRequiresBrowserKit74(FunctionalTester $I) + { + $I->amOnPage('/'); + + try { + $I->assertBrowserHistoryIsNotOnLastPage(); + $I->fail('assertBrowserHistoryIsNotOnLastPage should fail when symfony/browser-kit < 7.4.'); + } catch (ExpectationFailedException $e) { + $I->assertStringContainsString('requires symfony/browser-kit >= 7.4', $e->getMessage()); + } + } + public function assertRequestAttributeValueSame(FunctionalTester $I) { $I->amOnPage('/request_attr');