TestTimberImage::testAnimatedGifResize PHP 메소드

testAnimatedGifResize() 공개 메소드

    function testAnimatedGifResize()
    {
        if (!extension_loaded('imagick')) {
            self::markTestSkipped('Animated GIF resizing test requires Imagick extension');
        }
        $image = self::copyTestImage('robocop.gif');
        $data = array('crop' => 'default');
        $data['size'] = array('width' => 90, 'height' => 90);
        $upload_dir = wp_upload_dir();
        $url = $upload_dir['url'] . '/robocop.gif';
        $data['test_image'] = $url;
        Timber::compile('assets/image-test.twig', $data);
        $resized_path = $upload_dir['path'] . '/robocop-' . $data['size']['width'] . 'x' . $data['size']['height'] . '-c-' . $data['crop'] . '.gif';
        $this->addFile($resized_path);
        $this->assertFileExists($resized_path);
        $this->assertTrue(TimberImageHelper::is_animated_gif($resized_path));
    }