You are here

public function CrawlerTest::testAddHtmlContentInvalidBaseTag 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::testAddHtmlContentInvalidBaseTag()

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

File

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

Class

CrawlerTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testAddHtmlContentInvalidBaseTag() {
  $crawler = new Crawler(null, 'http://symfony.com');
  $crawler
    ->addHtmlContent('<html><head><base target="_top"></head><a href="/contact"></a></html>', 'UTF-8');
  $this
    ->assertEquals('http://symfony.com/contact', current($crawler
    ->filterXPath('//a')
    ->links())
    ->getUri(), '->addHtmlContent() correctly handles a non-existent base tag href attribute');
}