Symfony\Component\DomCrawler\Tests\CrawlerTest::testFilterXPathWithCustomDefaultNamespace PHP Method

testFilterXPathWithCustomDefaultNamespace() public method

    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());
    }
CrawlerTest