コード例 #1
0
 /**
  * @test
  */
 public function itShouldCreateTwoSiteMapFiles()
 {
     $j = 1;
     $url = 'http://www.example.com/gallery-' . $j . '.html';
     for ($i = 0; $i < 50020; ++$i) {
         if (0 === $i % 1001) {
             $url = 'http://www.example.com/gallery-' . $j . '.html';
             ++$j;
         }
         $imageUrl = 'http://www.example.com/' . $i . '.jpg';
         $item = new ImageItem($imageUrl);
         $this->siteMap->add($item, $url);
     }
     $this->siteMap->build();
     $this->assertFileExists('sitemaptest.xml');
     for ($i = 1; $i <= 49; ++$i) {
         $this->assertFileExists('sitemaptest' . $i . '.xml');
         \unlink('sitemaptest' . $i . '.xml');
     }
 }
コード例 #2
0
 /**
  * @return mixed
  */
 public function build()
 {
     return parent::build();
 }