Skip to content

Conversation

@santysisi
Copy link
Contributor

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues no
License MIT

This PR introduces two new PHPUnit constraints to improve testing of browser navigation history state:

  • BrowserHistoryIsOnFirstPage
  • BrowserHistoryIsOnLastPage

These constraints allow asserting the current state of the AbstractBrowser history using the following new assertion methods:

$this->assertBrowserHistoryIsOnFirstPage();
$this->assertBrowserHistoryIsNotOnFirstPage();
$this->assertBrowserHistoryIsOnLastPage();
$this->assertBrowserHistoryIsNotOnLastPage();

@carsonbot carsonbot added this to the 7.4 milestone Jun 30, 2025
@santysisi santysisi force-pushed the feature/browser-history-constraints branch from d07a653 to ca833f1 Compare June 30, 2025 04:08
@santysisi santysisi force-pushed the feature/browser-history-constraints branch from ca833f1 to 76e80c1 Compare June 30, 2025 04:20

public static function assertBrowserHistoryIsOnFirstPage(string $message = ''): void
{
if (!method_exists(History::class, 'isFirstPage')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of these checks, what about raising the requirement to 7.4 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi 👋, thanks for your comment! 😀

Personally, I don't have a strong preference, but in a previous PR, @nicolas-grekas mentioned not bumping versions 😅. If you'd prefer, I can raise the version to 7.4 🚀

Thanks again for your input! 🙏

@fabpot
Copy link
Member

fabpot commented Jul 26, 2025

Thank you @santysisi.

@fabpot fabpot merged commit d219ebe into symfony:7.4 Jul 26, 2025
9 of 11 checks passed
This was referenced Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants