diff --git a/src/Symfony/Component/DomCrawler/Test/Constraint/CrawlerSelectorTextContains.php b/src/Symfony/Component/DomCrawler/Test/Constraint/CrawlerSelectorTextContains.php index 0ddca40869..c9d996175e 100644 --- a/src/Symfony/Component/DomCrawler/Test/Constraint/CrawlerSelectorTextContains.php +++ b/src/Symfony/Component/DomCrawler/Test/Constraint/CrawlerSelectorTextContains.php @@ -45,7 +45,7 @@ final class CrawlerSelectorTextContains extends Constraint return false; } - return false !== mb_strpos($crawler->text(), $this->expectedText); + return false !== mb_strpos($crawler->text(null, false), $this->expectedText); } /** diff --git a/src/Symfony/Component/DomCrawler/Test/Constraint/CrawlerSelectorTextSame.php b/src/Symfony/Component/DomCrawler/Test/Constraint/CrawlerSelectorTextSame.php index 30271f0191..66adadd9d4 100644 --- a/src/Symfony/Component/DomCrawler/Test/Constraint/CrawlerSelectorTextSame.php +++ b/src/Symfony/Component/DomCrawler/Test/Constraint/CrawlerSelectorTextSame.php @@ -45,7 +45,7 @@ final class CrawlerSelectorTextSame extends Constraint return false; } - return $this->expectedText === trim($crawler->text()); + return $this->expectedText === trim($crawler->text(null, false)); } /**