Tests: Starter content tests should use copies of images stored in /tmp.

This ensures that generated thumbnails are kept out of the version-
controlled `DIR_TESTDATA` directory.

Props bor0.
Fixes #40008.

git-svn-id: https://develop.svn.wordpress.org/trunk@40142 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges 2017-03-02 02:25:05 +00:00
parent e799a8f4ca
commit 735424428c
1 changed files with 10 additions and 4 deletions

View File

@ -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(