Skip to content

[BrowserKit] Add browser history assertions to docs #21252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 7.4
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,10 @@ Browser Assertions
``assertBrowserCookieValueSame(string $name, string $expectedValue, string $path = '/', ?string $domain = null, string $message = '')``
Asserts the given cookie in the test Client is set to the expected
value.
``assertBrowserHistoryIsOnFirstPage(string $message = '')``/``assertBrowserHistoryIsNotOnFirstPage(string $message = '')``
Asserts that the browser history is (not) on the first page.
``assertBrowserHistoryIsOnLastPage(string $message = '')``/``assertBrowserHistoryIsNotOnLastPage(string $message = '')``
Asserts that the browser history is (not) on the last page.
``assertThatForClient(Constraint $constraint, string $message = '')``
Asserts the given Constraint in the Client. Useful for using your custom asserts
in the same way as built-in asserts (i.e. without passing the Client as argument)::
Expand All @@ -1057,6 +1061,10 @@ Browser Assertions
self::assertThatForClient(new SomeCustomConstraint());
}

.. versionadded:: 7.4

The ``assertBrowserHistoryIsOnFirstPage()`` and ``assertBrowserHistoryIsOnLastPage()`` assertions were introduced in Symfony 7.4.

Crawler Assertions
..................

Expand Down