Skip to content

Commit 9f68fe2

Browse files
committed
bug #39856 [DomCrawler] improve failure messages of the CrawlerSelectorTextContains constraint (xabbuh)
This PR was merged into the 4.4 branch. Discussion ---------- [DomCrawler] improve failure messages of the CrawlerSelectorTextContains constraint | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #33551, #37757 | License | MIT | Doc PR | Commits ------- ba451ab7b2 improve failure messages of the CrawlerSelectorTextContains constraint
2 parents 59fdd2d + 17ff931 commit 9f68fe2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Tests/Test/WebTestCaseTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public function testAssertSelectorTextNotContains()
183183
{
184184
$this->getCrawlerTester(new Crawler('<html><body><h1>Foo'))->assertSelectorTextNotContains('body > h1', 'Bar');
185185
$this->expectException(AssertionFailedError::class);
186-
$this->expectExceptionMessage('matches selector "body > h1" and does not have a node matching selector "body > h1" with content containing "Foo".');
186+
$this->expectExceptionMessage('matches selector "body > h1" and the text "Foo" of the node matching selector "body > h1" does not contain "Foo".');
187187
$this->getCrawlerTester(new Crawler('<html><body><h1>Foo'))->assertSelectorTextNotContains('body > h1', 'Foo');
188188
}
189189

@@ -199,7 +199,7 @@ public function testAssertPageTitleContains()
199199
{
200200
$this->getCrawlerTester(new Crawler('<html><head><title>Foobar'))->assertPageTitleContains('Foo');
201201
$this->expectException(AssertionFailedError::class);
202-
$this->expectExceptionMessage('matches selector "title" and has a node matching selector "title" with content containing "Bar".');
202+
$this->expectExceptionMessage('matches selector "title" and the text "Foo" of the node matching selector "title" contains "Bar".');
203203
$this->getCrawlerTester(new Crawler('<html><head><title>Foo'))->assertPageTitleContains('Bar');
204204
}
205205

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"symfony/browser-kit": "^4.3|^5.0",
4040
"symfony/console": "^4.4.21|^5.0",
4141
"symfony/css-selector": "^3.4|^4.0|^5.0",
42-
"symfony/dom-crawler": "^4.3|^5.0",
42+
"symfony/dom-crawler": "^4.4.20|^5.2.4",
4343
"symfony/dotenv": "^4.3.6|^5.0",
4444
"symfony/polyfill-intl-icu": "~1.0",
4545
"symfony/form": "^4.3.5|^5.0",

0 commit comments

Comments
 (0)