Skip to content

Commit 993546b

Browse files
minor symfony#23859 [DomCrawler] Fix testHtml method with regexp (MatthieuMota)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes symfony#23859). Discussion ---------- [DomCrawler] Fix testHtml method with regexp | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#23858 | License | MIT | Doc PR | no As explained in this issue symfony#23858, adding a regexp in addition to the trim for the testHtml method of [CrawlerTest](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php#L397) class. Commits ------- 339592d Fix testHtml method with regexp
2 parents 1b9619c + 339592d commit 993546b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public function testText()
353353
public function testHtml()
354354
{
355355
$this->assertEquals('<img alt="Bar">', $this->createTestCrawler()->filterXPath('//a[5]')->html());
356-
$this->assertEquals('<input type="text" value="TextValue" name="TextName"><input type="submit" value="FooValue" name="FooName" id="FooId"><input type="button" value="BarValue" name="BarName" id="BarId"><button value="ButtonValue" name="ButtonName" id="ButtonId"></button>', trim($this->createTestCrawler()->filterXPath('//form[@id="FooFormId"]')->html()));
356+
$this->assertEquals('<input type="text" value="TextValue" name="TextName"><input type="submit" value="FooValue" name="FooName" id="FooId"><input type="button" value="BarValue" name="BarName" id="BarId"><button value="ButtonValue" name="ButtonName" id="ButtonId"></button>', trim(preg_replace('~>\s+<~', '><', $this->createTestCrawler()->filterXPath('//form[@id="FooFormId"]')->html())));
357357

358358
try {
359359
$this->createTestCrawler()->filterXPath('//ol')->html();

0 commit comments

Comments
 (0)