function testDefaultImageInFilePath() { $file_path = realpath(ABSPATH . 'foo.png'); $default = dirname(__FILE__) . '/images/google.png'; $thumb = new WP_Thumb($file_path, array('default' => $default, 'width' => 20, 'height' => 20)); $this->assertEquals($thumb->getFilePath(), $default); $this->assertFalse($thumb->errored()); }
/** * * @group http */ function testFileWithLocalURL() { $path = dirname(__FILE__) . '/images/google.png'; $url = str_replace(WP_CONTENT_DIR, WP_CONTENT_URL, $path); $image = new WP_Thumb(); $image->setFilePath($url); $this->assertFalse($image->errored(), 'Image error occured'); $this->assertEquals($path, $image->getFilePath()); }