You are here

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

File

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

Class

CrawlerTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testFilterWithDefaultNamespaceOnly() {
  $crawler = new Crawler('<?xml version="1.0" encoding="UTF-8"?>
            <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
                <url>
                    <loc>http://localhost/foo</loc>
                    <changefreq>weekly</changefreq>
                    <priority>0.5</priority>
                    <lastmod>2012-11-16</lastmod>
               </url>
               <url>
                    <loc>http://localhost/bar</loc>
                    <changefreq>weekly</changefreq>
                    <priority>0.5</priority>
                    <lastmod>2012-11-16</lastmod>
                </url>
            </urlset>
        ');
  $this
    ->assertEquals(2, $crawler
    ->filter('url')
    ->count());
}