Skip to content

Commit 17ff931

Browse files
committed
improve failure messages of the CrawlerSelectorTextContains constraint
1 parent 08cf386 commit 17ff931

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
@@ -38,7 +38,7 @@
3838
"symfony/browser-kit": "^4.3|^5.0",
3939
"symfony/console": "^4.3.4|^5.0",
4040
"symfony/css-selector": "^3.4|^4.0|^5.0",
41-
"symfony/dom-crawler": "^4.3|^5.0",
41+
"symfony/dom-crawler": "^4.4.20|^5.2.4",
4242
"symfony/dotenv": "^4.3.6|^5.0",
4343
"symfony/polyfill-intl-icu": "~1.0",
4444
"symfony/form": "^4.3.5|^5.0",

0 commit comments

Comments
 (0)