/** * @dataProvider testToXmlProvider */ public function testToXml($expectedXml, $loc, $caption = null, $geoLocalisation = null, $title = null, $license = null) { try { $image = new Sitemap\Url\GoogleImage($loc, $caption, $geoLocalisation, $title, $license); } catch (\RuntimeException $e) { $this->fail('An exception must not be thrown'); } $this->assertEquals($expectedXml, $image->toXML()); }
public function addImage(GoogleImage $image) { if ($this->isFull()) { throw new Exception\GoogleImageUrlDecorator('The image limit has been exceeded'); } $this->imageXml .= $image->toXml(); //--------------------- //Check limits if ($this->countItems++ >= self::LIMIT_ITEMS) { $this->limitItemsReached = true; } //--------------------- return $this; }