/** * @test * @medium * @group image-execute * @group image */ public function 正常な処理() { $url = 'http://app2641.com/resources/images/profile.png'; $title = 'app2641.com'; $this->manager->setS3($this->S3); $this->manager->execute($url, $title); $datetime = new \DateTime('now'); $image_path = sprintf(ROOT . '/public_html/contents/%s/%s/%s/e2eed553b0ec153428ed8cd7f051029c.png', $datetime->format('Y'), $datetime->format('m'), $datetime->format('d')); $this->assertTrue(file_exists($image_path)); if (file_exists($image_path)) { unlink($image_path); } }
/** * アイキャッチ画像のダウンロードを行う * * @return void **/ private function _downloadEyeCatchImages() { $manager = new ImageManager(); $manager->setS3(new S3()); foreach ($this->crawl_data as $key => $data) { $manager->execute($data->eyecatch, $data->title); $this->crawl_data[$key]->image_src = $manager->getDownloadPath(); } }