You are here

public function CrawlerTest::testFilterXPathWithCustomDefaultNamespace in Zircon Profile 8.0

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

File

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

Class

CrawlerTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testFilterXPathWithCustomDefaultNamespace() {
  $crawler = $this
    ->createTestXmlCrawler();
  $crawler
    ->setDefaultNamespacePrefix('x');
  $crawler = $crawler
    ->filterXPath('//x:entry/x:id');
  $this
    ->assertCount(1, $crawler, '->filterXPath() lets to override the default namespace prefix');
  $this
    ->assertSame('tag:youtube.com,2008:video:kgZRZmEc9j4', $crawler
    ->text());
}