Make WordPress Core

Changeset 40142


Ignore:
Timestamp:
03/02/2017 02:25:05 AM (8 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/customize/manager.php

    r40041 r40142  
    5959        $this->manager = $this->instantiate();
    6060        $this->undefined = new stdClass();
     61
     62        $orig_file = DIR_TESTDATA . '/images/canola.jpg';
     63        $this->test_file = '/tmp/canola.jpg';
     64        copy( $orig_file, $this->test_file );
     65        $orig_file2 = DIR_TESTDATA . '/images/waffles.jpg';
     66        $this->test_file2 = '/tmp/waffles.jpg';
     67        copy( $orig_file2, $this->test_file2 );
    6168    }
    6269
     
    319326        add_theme_support( 'custom-background' );
    320327
    321         $canola_file = DIR_TESTDATA . '/images/canola.jpg';
    322         $existing_canola_attachment_id = self::factory()->attachment->create_object( $canola_file, 0, array(
     328        $existing_canola_attachment_id = self::factory()->attachment->create_object( $this->test_file, 0, array(
    323329            'post_mime_type' => 'image/jpeg',
    324330            'post_type' => 'attachment',
     
    384390                    'post_content' => 'Waffles Attachment Description',
    385391                    'post_excerpt' => 'Waffles Attachment Caption',
    386                     'file' => DIR_TESTDATA . '/images/waffles.jpg',
     392                    'file' => $this->test_file2,
    387393                ),
    388394                'canola' => array(
     
    390396                    'post_content' => 'Canola Attachment Description',
    391397                    'post_excerpt' => 'Canola Attachment Caption',
    392                     'file' => DIR_TESTDATA . '/images/canola.jpg',
     398                    'file' => $this->test_file,
    393399                ),
    394400            ),
Note: See TracChangeset for help on using the changeset viewer.