X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fdom-crawler%2FTests%2FCrawlerTest.php;h=9b2d1241949d1cbc4d7a6b6021459f3663c92a0b;hb=refs%2Fheads%2Fmaster;hp=39b4a7aefbd5e8be4939af779db4ae7084298c82;hpb=eba34333e3c89f208d2f72fa91351ad019a71583;p=yaffs-website diff --git a/vendor/symfony/dom-crawler/Tests/CrawlerTest.php b/vendor/symfony/dom-crawler/Tests/CrawlerTest.php index 39b4a7aef..9b2d12419 100644 --- a/vendor/symfony/dom-crawler/Tests/CrawlerTest.php +++ b/vendor/symfony/dom-crawler/Tests/CrawlerTest.php @@ -204,7 +204,7 @@ EOF EOF , 'UTF-8'); - $this->assertTrue(count(libxml_get_errors()) > 1); + $this->assertGreaterThan(1, libxml_get_errors()); libxml_clear_errors(); libxml_use_internal_errors($internalErrors); @@ -339,7 +339,7 @@ EOF { $crawler = $this->createTestCrawler()->filterXPath('//ul[1]/li'); $nodes = $crawler->reduce(function ($node, $i) { - return $i !== 1; + return 1 !== $i; }); $this->assertNotSame($nodes, $crawler, '->reduce() returns a new instance of a crawler'); $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $nodes, '->reduce() returns a new instance of a crawler'); @@ -397,7 +397,7 @@ EOF public function testHtml() { $this->assertEquals('Bar', $this->createTestCrawler()->filterXPath('//a[5]')->html()); - $this->assertEquals('', trim($this->createTestCrawler()->filterXPath('//form[@id="FooFormId"]')->html())); + $this->assertEquals('', trim(preg_replace('~>\s+<~', '><', $this->createTestCrawler()->filterXPath('//form[@id="FooFormId"]')->html()))); try { $this->createTestCrawler()->filterXPath('//ol')->html(); @@ -413,6 +413,7 @@ EOF $this->assertEquals(array('One', 'Two', 'Three'), $crawler->extract('_text'), '->extract() returns an array of extracted data from the node list'); $this->assertEquals(array(array('One', 'first'), array('Two', ''), array('Three', '')), $crawler->extract(array('_text', 'class')), '->extract() returns an array of extracted data from the node list'); + $this->assertEquals(array(array(), array(), array()), $crawler->extract(array()), '->extract() returns empty arrays if the attribute list is empty'); $this->assertEquals(array(), $this->createTestCrawler()->filterXPath('//ol')->extract('_text'), '->extract() returns an empty array if the node list is empty'); } @@ -1026,7 +1027,7 @@ HTML; /** * @dataProvider getBaseTagData */ - public function testBaseTag($baseValue, $linkValue, $expectedUri, $currentUri = null, $description = null) + public function testBaseTag($baseValue, $linkValue, $expectedUri, $currentUri = null, $description = '') { $crawler = new Crawler('', $currentUri); $this->assertEquals($expectedUri, $crawler->filterXPath('//a')->link()->getUri(), $description);