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:
parent
e799a8f4ca
commit
735424428c
|
@ -58,6 +58,13 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase {
|
||||||
require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
|
require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
|
||||||
$this->manager = $this->instantiate();
|
$this->manager = $this->instantiate();
|
||||||
$this->undefined = new stdClass();
|
$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-header' );
|
||||||
add_theme_support( 'custom-background' );
|
add_theme_support( 'custom-background' );
|
||||||
|
|
||||||
$canola_file = DIR_TESTDATA . '/images/canola.jpg';
|
$existing_canola_attachment_id = self::factory()->attachment->create_object( $this->test_file, 0, array(
|
||||||
$existing_canola_attachment_id = self::factory()->attachment->create_object( $canola_file, 0, array(
|
|
||||||
'post_mime_type' => 'image/jpeg',
|
'post_mime_type' => 'image/jpeg',
|
||||||
'post_type' => 'attachment',
|
'post_type' => 'attachment',
|
||||||
'post_name' => 'canola',
|
'post_name' => 'canola',
|
||||||
|
@ -383,13 +389,13 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase {
|
||||||
'post_title' => 'Waffles',
|
'post_title' => 'Waffles',
|
||||||
'post_content' => 'Waffles Attachment Description',
|
'post_content' => 'Waffles Attachment Description',
|
||||||
'post_excerpt' => 'Waffles Attachment Caption',
|
'post_excerpt' => 'Waffles Attachment Caption',
|
||||||
'file' => DIR_TESTDATA . '/images/waffles.jpg',
|
'file' => $this->test_file2,
|
||||||
),
|
),
|
||||||
'canola' => array(
|
'canola' => array(
|
||||||
'post_title' => 'Canola',
|
'post_title' => 'Canola',
|
||||||
'post_content' => 'Canola Attachment Description',
|
'post_content' => 'Canola Attachment Description',
|
||||||
'post_excerpt' => 'Canola Attachment Caption',
|
'post_excerpt' => 'Canola Attachment Caption',
|
||||||
'file' => DIR_TESTDATA . '/images/canola.jpg',
|
'file' => $this->test_file,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'options' => array(
|
'options' => array(
|
||||||
|
|
Loading…
Reference in New Issue