public function testFetchAndConvert()
 {
     $this->markTestSkipped('GetfaviconFetcher on appspot seems broken.');
     $fetcher = new GetFaviconFetcher();
     $fetcher->setConverter(new ImageMagickIcoPngConverter());
     $destination = __DIR__ . '/../Resources/new_getfavicon_favicon.ico';
     $png = __DIR__ . '/../Resources/new_getfavicon_favicon.png';
     $generated = $fetcher->fetch('http://github.com', $destination);
     $this->assertTrue($generated);
     $this->assertTrue(file_exists($png));
 }
 /**
  * @param string $imageDir
  * @param null   $defaultImg
  * @return FaviconFetcher
  */
 public static function create($imageDir = '/tmp/', $defaultImg = null)
 {
     if (is_null($defaultImg) || !file_exists($defaultImg)) {
         $defaultImg = __DIR__ . '/../tests/Resources/default_favicon_image.png';
     }
     $getFaviconService = new GetFaviconFetcher();
     $converter = new ImageMagickIcoPngConverter();
     $getFaviconService->setConverter($converter);
     return new self([new GoogleFetcher(), $getFaviconService, new FaviconIcoFetcher($converter), new DefaultFetcher($defaultImg)], new DomainFileNameResolver($prefix = '', $suffix = '.png'), $imageDir);
 }