You are here

public function CrawlerTest::testAddXmlContentWithErrors in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dom-crawler/Tests/CrawlerTest.php \Symfony\Component\DomCrawler\Tests\CrawlerTest::testAddXmlContentWithErrors()

@covers Symfony\Component\DomCrawler\Crawler::addXmlContent

File

vendor/symfony/dom-crawler/Tests/CrawlerTest.php, line 183

Class

CrawlerTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testAddXmlContentWithErrors() {
  $internalErrors = libxml_use_internal_errors(true);
  $crawler = new Crawler();
  $crawler
    ->addXmlContent(<<<EOF
<!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
        <nav><a href="#"><a href="#"></nav>
    </body>
</html>
EOF
, 'UTF-8');
  $this
    ->assertTrue(count(libxml_get_errors()) > 1);
  libxml_clear_errors();
  libxml_use_internal_errors($internalErrors);
}