Closed
Description
As I was updating one of my packages I noticed that the test where all failing with 2.8.
After some research I found out that the DomCrawler was not working as expected when selecting a attribute using //div/@id
.
I created the following test for CrawlerTest.php
that shows the break:
public function testFilterXPathAttribute()
{
$crawler = $this->createTestCrawler();
$formIds = $crawler->filterXPath('//form/@action');
$this->assertCount(1, $formIds, '->filterXPath() finds node attributes');
$this->assertEquals('foo', $formIds->html(), '->filterXPath() returns the html of the found attribute');
$divIds = $crawler->filterXPath('//form/@id');
$this->assertCount(1, $divIds, '->filterXPath() finds node attributes');
$this->assertEquals('FooFormId', $divIds->html(), '->filterXPath() returns the html of the first attribute');
}