Wouldn't it be incredible if you could run Unit Tests without all of your uploads being indiscriminately blown away and your upload folder permissions being destroyed?

The Future Is Now.

Fixes #28847.


git-svn-id: https://develop.svn.wordpress.org/trunk@29120 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-07-12 07:08:15 +00:00
parent 04b0ec782b
commit d97b10eecf
15 changed files with 125 additions and 48 deletions

View File

@@ -9,6 +9,8 @@ abstract class WP_Image_UnitTestCase extends WP_UnitTestCase {
* Set the image editor engine according to the unit test's specification
*/
public function setUp() {
parent::setUp();
if ( ! call_user_func( array( $this->editor_engine, 'test' ) ) ) {
$this->markTestSkipped( sprintf('The image editor engine %s is not supported on this system', $this->editor_engine) );
}
@@ -20,6 +22,8 @@ abstract class WP_Image_UnitTestCase extends WP_UnitTestCase {
* Undo the image editor override
*/
public function tearDown() {
parent::tearDown();
remove_filter( 'wp_image_editors', array( $this, 'setEngine' ), 10, 2 );
}
@@ -33,7 +37,7 @@ abstract class WP_Image_UnitTestCase extends WP_UnitTestCase {
/**
* Helper assertion for testing alpha on images
*
*
* @param string $image_path
* @param array $point array(x,y)
* @param int $alpha