Skip to content

[6.4] Verify assertBrowserHistoryIsNotOnLastPage is unavailable on browser-kit < 7.4#61

Merged
TavoNiievez merged 1 commit into
Codeception:6.4from
TavoNiievez:browser-history-not-on-last-page-6.4
Jun 26, 2026
Merged

[6.4] Verify assertBrowserHistoryIsNotOnLastPage is unavailable on browser-kit < 7.4#61
TavoNiievez merged 1 commit into
Codeception:6.4from
TavoNiievez:browser-history-not-on-last-page-6.4

Conversation

@TavoNiievez

Copy link
Copy Markdown
Member

Companion to #58 (7.4) and #59 (8.1). The assertBrowserHistoryIsNotOnLastPage assertion from Codeception/module-symfony#240 requires symfony/browser-kit >= 7.4. On Symfony 6.4 that constraint class does not exist, so the step is intentionally unavailable and the module guards it.

This test pins that documented behaviour: calling the step throws PHPUnit\Framework\ExpectationFailedException carrying the requires symfony/browser-kit >= 7.4 message.

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());
    }
}

No composer.lock bump needed here — the assertion is unavailable on this branch, so it does not depend on lib-innerbrowser 4.1.1. Validated locally against Symfony 6.4 (browser-kit v6.4.32).

On Symfony 6.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.
@TavoNiievez TavoNiievez merged commit 9fcffdc into Codeception:6.4 Jun 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant