8000 bug #36259 [DomCrawler] Fix BC break in assertions breaking Panther (… · symfony/symfony@ff2c362 · GitHub
[go: up one dir, main page]

Skip to content

Commit ff2c362

Browse files
bug #36259 [DomCrawler] Fix BC break in assertions breaking Panther (dunglas)
This PR was merged into the 4.4 branch. Discussion ---------- [DomCrawler] Fix BC break in assertions breaking Panther | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a | License | MIT | Doc PR | n/a #35899 introduces a BC break: browsers aren't able to retrieve the non-normalized version of a text. According to the HTML spec, whitespaces are always normalized. Because of this patch, these assertions doesn't work with Panther anymore. Also, this change probably hurts other users because getting the non-normalized version is almost never expected. (I'm in favor of **not** supporting retrieving the non-normalized version at all, for consistency with browsers and the spec, but it's another topic). Commits ------- 7af07c8 [DomCrawler] Fix BC break in assertions breaking Panther
2 parents b580dd8 + 7af07c8 commit ff2c362

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/DomCrawler/Test/Constraint/CrawlerSelectorTextContains.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function matches($crawler): bool
4545
return false;
4646
}
4747

48-
return false !== mb_strpos($crawler->text(null, false), $this->expectedText);
48+
return false !== mb_strpos($crawler->text(null, true), $this->expectedText);
4949
}
5050

5151
/**

src/Symfony/Component/DomCrawler/Test/Constraint/CrawlerSelectorTextSame.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function matches($crawler): bool
4545
return false;
4646
}
4747

48-
return $this->expectedText === trim($crawler->text(null, false));
48+
return $this->expectedText === trim($crawler->text(null, true));
4949
}
5050

5151
/**

0 commit comments

Comments
 (0)
0