diff --git a/tests/phpunit/tests/customize/manager.php b/tests/phpunit/tests/customize/manager.php index 70fa395183..3927ce345c 100644 --- a/tests/phpunit/tests/customize/manager.php +++ b/tests/phpunit/tests/customize/manager.php @@ -58,6 +58,13 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase { require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' ); $this->manager = $this->instantiate(); $this->undefined = new stdClass(); + + $orig_file = DIR_TESTDATA . '/images/canola.jpg'; + $this->test_file = '/tmp/canola.jpg'; + copy( $orig_file, $this->test_file ); + $orig_file2 = DIR_TESTDATA . '/images/waffles.jpg'; + $this->test_file2 = '/tmp/waffles.jpg'; + copy( $orig_file2, $this->test_file2 ); } /** @@ -318,8 +325,7 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase { add_theme_support( 'custom-header' ); add_theme_support( 'custom-background' ); - $canola_file = DIR_TESTDATA . '/images/canola.jpg'; - $existing_canola_attachment_id = self::factory()->attachment->create_object( $canola_file, 0, array( + $existing_canola_attachment_id = self::factory()->attachment->create_object( $this->test_file, 0, array( 'post_mime_type' => 'image/jpeg', 'post_type' => 'attachment', 'post_name' => 'canola', @@ -383,13 +389,13 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase { 'post_title' => 'Waffles', 'post_content' => 'Waffles Attachment Description', 'post_excerpt' => 'Waffles Attachment Caption', - 'file' => DIR_TESTDATA . '/images/waffles.jpg', + 'file' => $this->test_file2, ), 'canola' => array( 'post_title' => 'Canola', 'post_content' => 'Canola Attachment Description', 'post_excerpt' => 'Canola Attachment Caption', - 'file' => DIR_TESTDATA . '/images/canola.jpg', + 'file' => $this->test_file, ), ), 'options' => array(