public function testAddUrlBaseHostToImages()
 {
     $dumper = new TestableMemoryDumper();
     $sitemap = new TestableSitemap($dumper, new TextFormatter(), 'http://www.google.fr');
     $url = new Url();
     $url->setLoc('http://www.joe.fr/search');
     $image = new Image();
     $image->setLoc('/thumbs/123.jpg');
     $image->setLicense('/lic/MIT.txt');
     $url->addImage($image);
     $sitemap->add($url);
     $this->assertEquals('http://www.google.fr/thumbs/123.jpg', $image->getLoc());
     $this->assertEquals('http://www.google.fr/lic/MIT.txt', $image->getLicense());
 }
 public function testFormatUrlWithFullImage()
 {
     $url = new Url();
     $url->setLoc('http://www.google.fr/?s=joe"');
     $url->setPriority(0.2);
     $url->setChangefreq(Url::CHANGEFREQ_NEVER);
     $image = new Image();
     $image->setLoc('http://www.example.com/thumbs/123.jpg');
     $image->setTitle('Grilling steaks for "summer"');
     $image->setCaption('Some caption');
     $image->setLicense('http://opensource.org/licenses/mit-license.php');
     $image->setGeoLocation('France');
     $url->addImage($image);
     $this->assertEquals("<url>\n" . "\t<loc>http://www.google.fr/?s=joe&quot;</loc>\n" . "\t<changefreq>never</changefreq>\n" . "\t<priority>0.2</priority>\n" . "\t<image:image>\n" . "\t\t<image:loc>http://www.example.com/thumbs/123.jpg</image:loc>\n" . "\t\t<image:caption>Some caption</image:caption>\n" . "\t\t<image:geo_location>France</image:geo_location>\n" . "\t\t<image:title>Grilling steaks for &quot;summer&quot;</image:title>\n" . "\t\t<image:license>http://opensource.org/licenses/mit-license.php</image:license>\n" . "\t</image:image>\n" . "</url>\n", $this->formatter->formatUrl($url));
 }