TestTimberImage::testLetterboxImageDeletion PHP Method

testLetterboxImageDeletion() public method

    function testLetterboxImageDeletion()
    {
        if (!extension_loaded('gd')) {
            self::markTestSkipped('Letterbox image test requires GD extension');
        }
        $data = array();
        $file = self::copyTestImage('city-museum.jpg');
        $upload_dir = wp_upload_dir();
        $data['test_image'] = $upload_dir['url'] . '/city-museum.jpg';
        $new_file = TimberImageHelper::letterbox($data['test_image'], 500, 500, '#00FF00');
        $letterboxed_file = TimberImageHelper::get_letterbox_file_path($data['test_image'], 500, 500, '#00FF00');
        $this->assertFileExists($letterboxed_file);
        //Now delete the "parent" image
        TimberImageHelper::delete_generated_files($file);
        //Have the children been deleted as well?
        $this->assertFileNotExists($letterboxed_file);
    }