TestTimberImage::testResizeTallImage PHP Method

testResizeTallImage() public method

public testResizeTallImage ( )
    function testResizeTallImage()
    {
        $data = array();
        $data['size'] = array('width' => 600);
        $upload_dir = wp_upload_dir();
        self::copyTestImage('tall.jpg');
        $url = $upload_dir['url'] . '/tall.jpg';
        $data['test_image'] = $url;
        $data['crop'] = 'default';
        Timber::compile('assets/image-test-one-param.twig', $data);
        $resized_path = $upload_dir['path'] . '/tall-' . $data['size']['width'] . 'x0' . '-c-' . $data['crop'] . '.jpg';
        $exists = file_exists($resized_path);
        $this->assertTrue($exists);
        //make sure it's the width it's supposed to be
        $image = wp_get_image_editor($resized_path);
        if ($image instanceof WP_Error) {
            self::markTestSkipped('Tall image resizing test is skipped because no image editor is provided by WordPress, make sure that either GD or Imagick extension is installed');
        }
        $current_size = $image->get_size();
        $w = $current_size['width'];
        $this->assertEquals($w, 600);
    }