Add Symfony-inherited assertions (Browser, DomCrawler, Mailer, Mime)#240
Merged
Merged
Conversation
Bring assertion/getter methods that mirror Symfony's own test API into the matching module traits (assert*/get* family, per the naming convention): - BrowserAssertionsTrait: assertBrowserHistoryIsOnFirstPage / assertBrowserHistoryIsNotOnFirstPage / assertBrowserHistoryIsOnLastPage / assertBrowserHistoryIsNotOnLastPage (wrap symfony/browser-kit constraints) - DomCrawlerAssertionsTrait: assertSelectorCount, assertAnySelectorTextContains, assertAnySelectorTextSame, assertAnySelectorTextNotContains - MailerAssertionsTrait: getMailerEvents, getMailerMessages, getMailerMessage - MimeAssertionsTrait: assertEmailAddressNotContains, assertEmailSubjectContains, assertEmailSubjectNotContains Each method is guarded for the Symfony component version that introduced the underlying constraint. Unit tests added for every method.
This was referenced Jun 23, 2026
Merged
Merged
Merged
TavoNiievez
added a commit
to Codeception/symfony-module-tests
that referenced
this pull request
Jun 23, 2026
Covers the assertion/getter methods added in Codeception/module-symfony#240 that are available on Symfony 5.4: - MailerCest: getMailerEvents, getMailerMessages, getMailerMessage - MimeCest: assertEmailAddressNotContains Other assertions are omitted on 5.4 (their underlying Symfony constraints are newer): assertSelectorCount / assertAnySelectorText* (dom-crawler 6.4), assertEmailSubject* (mime 6.2), assertBrowserHistoryIs* (browser-kit 7.4). Refreshes composer.lock.
TavoNiievez
added a commit
to Codeception/symfony-module-tests
that referenced
this pull request
Jun 23, 2026
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
added a commit
to Codeception/symfony-module-tests
that referenced
this pull request
Jun 23, 2026
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
added a commit
to Codeception/symfony-module-tests
that referenced
this pull request
Jun 23, 2026
Covers the assertion/getter methods added in Codeception/module-symfony#240 that are available on Symfony 6.4: - DomCrawlerCest: assertSelectorCount, assertAnySelectorTextContains, assertAnySelectorTextSame, assertAnySelectorTextNotContains - MailerCest: getMailerEvents, getMailerMessages, getMailerMessage - MimeCest: assertEmailAddressNotContains, assertEmailSubjectContains, assertEmailSubjectNotContains Browser-history assertions are omitted: they require symfony/browser-kit >= 7.4. Refreshes composer.lock.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds assertion/getter methods that mirror Symfony's own test API, in the matching module traits. These belong to the
assert*/get*family of the naming convention documented inCONTRIBUTING.md: direct value/constraint comparisons that map closely to PHPUnit/Symfony assertion semantics.Methods
assertBrowserHistoryIsOnFirstPage,assertBrowserHistoryIsNotOnFirstPage,assertBrowserHistoryIsOnLastPage,assertBrowserHistoryIsNotOnLastPage(wrapsymfony/browser-kitconstraints)assertSelectorCount,assertAnySelectorTextContains,assertAnySelectorTextSame,assertAnySelectorTextNotContainsgetMailerEvents,getMailerMessages,getMailerMessageassertEmailAddressNotContains,assertEmailSubjectContains,assertEmailSubjectNotContainsEach method is guarded for the Symfony component version that introduced the underlying constraint.
Tests
Unit tests added for every method (
tests/BrowserAssertionsTest,DomCrawlerAssertionsTest,MailerAssertionsTest,MimeAssertionsTest).Notes
Split out from the original "new assertions" change. This PR contains only the Symfony-mirroring assertions; the module-specific
see*/dontSee*assertions (Doctrine, Environment, Security, Session) are in companion PR #218, for clear separation of responsibilities.