Skip to content

Add functional tests for inherited Symfony assertions (7.4)#45

Merged
TavoNiievez merged 1 commit into
Codeception:7.4from
TavoNiievez:inherited-asserts-7.4
Jun 23, 2026
Merged

Add functional tests for inherited Symfony assertions (7.4)#45
TavoNiievez merged 1 commit into
Codeception:7.4from
TavoNiievez:inherited-asserts-7.4

Conversation

@TavoNiievez

Copy link
Copy Markdown
Member

What

Functional tests for the inherited Symfony assertions added in Codeception/module-symfony#240.

Added tests

  • BrowserCest: assertBrowserHistoryIsOnFirstPage, assertBrowserHistoryIsNotOnFirstPage, assertBrowserHistoryIsOnLastPage
  • DomCrawlerCest: assertSelectorCount, assertAnySelectorTextContains, assertAnySelectorTextSame, assertAnySelectorTextNotContains
  • MailerCest: getMailerEvents, getMailerMessages, getMailerMessage
  • MimeCest: assertEmailAddressNotContains, assertEmailSubjectContains, assertEmailSubjectNotContains

All new methods are placed in alphabetical order, reuse the existing fixtures (/test_page, /send-email, registerUser()), and pass locally against module-symfony#240.

composer.lock refreshed.

Notes

  • assertBrowserHistoryIsNotOnLastPage is intentionally not covered here: reaching a "not on last page" state requires a raw client->back() (which keeps forward history), but the Codeception actor API only exposes moveBack(), which re-dispatches and truncates forward history — so the state is unreachable via functional steps. It is covered by the unit test in module-symfony#240.
  • The browser-history assertions require symfony/browser-kit ≥ 7.4, so they are included only on the 7.4 (and 8.1) branches.

Covers the assertion/getter methods added in Codeception/module-symfony#240:

- BrowserCest: assertBrowserHistoryIsOnFirstPage,
  assertBrowserHistoryIsNotOnFirstPage, assertBrowserHistoryIsOnLastPage
- DomCrawlerCest: assertSelectorCount, assertAnySelectorTextContains,
  assertAnySelectorTextSame, assertAnySelectorTextNotContains
- MailerCest: getMailerEvents, getMailerMessages, getMailerMessage
- MimeCest: assertEmailAddressNotContains, assertEmailSubjectContains,
  assertEmailSubjectNotContains

Refreshes composer.lock.
@TavoNiievez TavoNiievez merged commit fedd18e into Codeception:7.4 Jun 23, 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