WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/14/2020 01:28:17 AM (15 months ago)
Author:
SergeyBiryukov
Message:

Tests: Replace hardcoded /tmp/ references with get_temp_dir().

This allows more tests to pass on Windows.

Props danielhuesken, DJPaul, christophherr, joemcgill, netweb, davidbaumwald, SergeyBiryukov.
Fixes #40856, #39975.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php

    r48291 r48464  
    8181
    8282        $orig_file       = DIR_TESTDATA . '/images/canola.jpg';
    83         $this->test_file = '/tmp/canola.jpg';
     83        $this->test_file = get_temp_dir() . 'canola.jpg';
    8484        copy( $orig_file, $this->test_file );
    8585        $orig_file2       = DIR_TESTDATA . '/images/codeispoetry.png';
    86         $this->test_file2 = '/tmp/codeispoetry.png';
     86        $this->test_file2 = get_temp_dir() . 'codeispoetry.png';
    8787        copy( $orig_file2, $this->test_file2 );
    8888    }
Note: See TracChangeset for help on using the changeset viewer.