コード例 #1
0
 function testResizeFileNamingWithUploadsConst()
 {
     define('UPLOADS', 'my/up');
     $file_loc = self::copyTestImage('eastern.jpg');
     $upload_dir = wp_upload_dir();
     $url_src = $upload_dir['url'] . '/eastern.jpg';
     $filename = TimberImageHelper::get_resize_file_url($url_src, 300, 500, 'default');
     $this->assertEquals($upload_dir['url'] . '/eastern-300x500-c-default.jpg', $filename);
 }
コード例 #2
0
ファイル: test-timber-image.php プロジェクト: rpkoller/timber
 function testResizeFileNamingWithLangHome()
 {
     add_filter('home_url', array($this, 'add_lang_to_home'), 1, 4);
     $file_loc = self::copyTestImage('eastern.jpg');
     $upload_dir = wp_upload_dir();
     $url_src = $upload_dir['url'] . '/eastern.jpg';
     $filename = TimberImageHelper::get_resize_file_url($url_src, 300, 500, 'default');
     $this->assertEquals($upload_dir['url'] . '/eastern-300x500-c-default.jpg', $filename);
     remove_filter('home_url', array($this, 'add_lang_to_home'), 1);
 }