function testFileWithPathNoExtension() { $path = dirname(__FILE__) . '/images/google'; $image = new WP_Thumb(); $image->setFilePath($path); $this->assertFalse($image->errored()); $this->assertContains(WP_CONTENT_DIR, $image->getCacheFileDirectory()); $this->assertEquals('jpg', $image->getFileExtension()); }
/** * Hook into wp_delete_file and delete the associated cache files * * @param string $file * * @return string */ function wpthumb_delete_cache_for_file($file) { $upload_dir = wp_upload_dir(); $wpthumb = new WP_Thumb(trailingslashit($upload_dir['basedir']) . $file); wpthumb_rmdir_recursive($wpthumb->getCacheFileDirectory()); return $file; }