コード例 #1
0
 function testInitFromURL()
 {
     $destination_path = $this->copyTestImage();
     $destination_url = str_replace(ABSPATH, 'http://' . $_SERVER['HTTP_HOST'] . '/', $destination_path);
     $image = new TimberImage($destination_url);
     $this->assertEquals($destination_url, $image->get_src());
     $this->assertEquals($destination_url, (string) $image);
 }
コード例 #2
0
ファイル: test-timber-image.php プロジェクト: aauroux/timber
 function testInitFromURL()
 {
     $destination_path = self::copyTestImage();
     $destination_path = TimberURLHelper::get_rel_path($destination_path);
     $destination_url = 'http://' . $_SERVER['HTTP_HOST'] . $destination_path;
     $image = new TimberImage($destination_url);
     $this->assertEquals($destination_url, $image->get_src());
     $this->assertEquals($destination_url, (string) $image);
 }