assertInstanceOf('vipnytt\SitemapParser', $parser); $parser->parseRecursive($url); $this->assertInternalType('array', $parser->getSitemaps()); $this->assertInternalType('array', $parser->getURLs()); $this->assertTrue(count($parser->getSitemaps()) > 1 || count($parser->getURLs()) > 100); foreach ($parser->getSitemaps() as $url => $tags) { $this->assertInternalType('string', $url); $this->assertInternalType('array', $tags); $this->assertTrue($url === $tags['loc']); $this->assertNotFalse(filter_var($url, FILTER_VALIDATE_URL)); } foreach ($parser->getURLs() as $url => $tags) { $this->assertInternalType('string', $url); $this->assertInternalType('array', $tags); $this->assertTrue($url === $tags['loc']); $this->assertNotFalse(filter_var($url, FILTER_VALIDATE_URL)); } } /** * Generate test data * @return array */ public function generateDataForTest() { return [ [ 'https://edenapartmentsqueenanne.com/sitemap_index.xml', 'https://livingnongmo.org/sitemap.xml', 'https://loganwestom.com/sitemap_index.xml', 'https://sawyerflats.com/sitemap.xml', 'https://www.bellinghambaymarathon.org/sitemap_index.xml', 'https://www.coachforteens.com/sitemap_index.xml', 'https://www.hallerpostapts.com/sitemap_index.xml', 'https://www.nongmoproject.org/sitemap.xml', 'https://www.xml-sitemaps.com/robots.txt', ] ]; } }