TestTimberImage::testGifToJpg PHP Method

testGifToJpg() public method

public testGifToJpg ( )
    function testGifToJpg()
    {
        if (!extension_loaded('gd')) {
            self::markTestSkipped('JPEG conversion test requires GD extension');
        }
        $filename = self::copyTestImage('loading.gif');
        $gif_url = str_replace(ABSPATH, 'http://' . $_SERVER['HTTP_HOST'] . '/', $filename);
        $str = '<img src="{{' . "'{$gif_url}'" . '|tojpg}}" />';
        $result = Timber::compile_string($str);
        $jpg_url = str_replace('.gif', '.jpg', $gif_url);
        $this->assertEquals('<img src="' . $jpg_url . '" />', $result);
    }