Esempio n. 1
0
 /**
  * @test
  */
 public function itShouldCreate1MBSitemapFiles()
 {
     $this->siteMap = new Sitemap('.', 'sitemaptest2.xml', false, 1000000);
     for ($i = 0; $i < 10020; ++$i) {
         $this->addToSiteMap($i);
     }
     $this->siteMap->build();
     $this->assertLessThanOrEqual(1000000, \filesize('sitemaptest2.xml'));
     $this->assertLessThanOrEqual(1000000, \filesize('sitemaptest21.xml'));
 }
 /**
  * @param        $item
  * @param string $url
  */
 protected function createAdditionalSitemapFile($item, $url = '')
 {
     $this->appendToFile("</url>\n");
     parent::build();
     ++$this->totalFiles;
     $this->createNewFilePointer();
     $this->appendToFile($this->getHeader() . "<url>\n<loc>{$url}</loc>\n" . $item);
     $this->totalItems = 1;
     $this->imageCount = 0;
 }