/** * @param $i */ protected function addToSiteMap($i) { $item = new UrlItem('http://www.example.com/' . $i); $item->setPriority('1.0'); $item->setChangeFreq('daily'); $item->setLastMod('2014-05-10T17:33:30+08:00'); $this->siteMap->add($item); }
/** * @param $lastmod * * @throws IndexItemException * * @return $this */ public function setLastMod($lastmod) { try { parent::setLastMod($lastmod); } catch (UrlItemException $e) { throw new IndexItemException($e->getMessage()); } return $this; }
/** * @test */ public function itShouldOutputLastModAndThrowException() { $this->setExpectedException($this->exception); $this->item->setLastMod('a'); }