Make WordPress Core

Ticket #43038: 43038.patch

File 43038.patch, 8.0 KB (added by Clorith, 7 years ago)
  • tests/phpunit/tests/file.php

     
    88        function setUp() {
    99                parent::setUp();
    1010
    11                 $file      = tempnam( '/tmp', 'foo' );
     11                $file      = tempnam( DIR_TEST_TMP, 'foo' );
    1212                $this->dir = dirname( $file );
    1313                unlink( $file );
    1414
  • tests/phpunit/tests/widgets/media-widget.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    137137         */
    138138        function test_is_attachment_with_mime_type() {
    139139
    140                 $test_image = '/tmp/canola.jpg';
     140                $test_image = DIR_TEST_TMP . 'canola.jpg';
    141141                copy( DIR_TESTDATA . '/images/canola.jpg', $test_image );
    142142                $attachment_id = self::factory()->attachment->create_object(
    143143                        array(
  • tests/phpunit/tests/customize/manager.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    6060                $this->undefined = new stdClass();
    6161
    6262                $orig_file       = DIR_TESTDATA . '/images/canola.jpg';
    63                 $this->test_file = '/tmp/canola.jpg';
     63                $this->test_file = DIR_TEST_TMP . 'canola.jpg';
    6464                copy( $orig_file, $this->test_file );
    6565                $orig_file2       = DIR_TESTDATA . '/images/waffles.jpg';
    66                 $this->test_file2 = '/tmp/waffles.jpg';
     66                $this->test_file2 = DIR_TEST_TMP . 'waffles.jpg';
    6767                copy( $orig_file2, $this->test_file2 );
    6868        }
    6969
  • tests/phpunit/tests/upload.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    4646         * @ticket 5953
    4747         */
    4848        function test_upload_dir_absolute() {
    49                 $path = '/tmp/wp-unit-test';
     49                $path = DIR_TEST_TMP . 'wp-unit-test';
    5050
    5151                // wp_upload_dir() with an absolute upload path
    5252                update_option( 'upload_path', $path );
  • tests/phpunit/tests/widgets/media-gallery-widget.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    5858
    5959                $attachments = array();
    6060                foreach ( array( 'canola.jpg', 'waffles.jpg' ) as $filename ) {
    61                         $test_image = '/tmp/' . $filename;
     61                        $test_image = DIR_TEST_TMP . $filename;
    6262                        copy( DIR_TESTDATA . '/images/canola.jpg', $test_image );
    6363                        $attachment_id = self::factory()->attachment->create_object(
    6464                                array(
  • tests/phpunit/tests/widgets/media-image-widget.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    357357        function test_render_media() {
    358358                $widget = new WP_Widget_Media_Image();
    359359
    360                 $test_image = '/tmp/canola.jpg';
     360                $test_image = DIR_TEST_TMP . 'canola.jpg';
    361361                copy( DIR_TESTDATA . '/images/canola.jpg', $test_image );
    362362                $attachment_id = self::factory()->attachment->create_object(
    363363                        array(
  • tests/phpunit/tests/image/functions.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    2020                include_once( DIR_TESTDATA . '/../includes/mock-image-editor.php' );
    2121
    2222                // Ensure no legacy / failed tests detritus.
    23                 $folder = '/tmp/wordpress-gsoc-flyer*.{jpg,pdf}';
     23                $folder = DIR_TEST_TMP . 'wordpress-gsoc-flyer*.{jpg,pdf}';
    2424
    2525                foreach ( glob( $folder, GLOB_BRACE ) as $file ) {
    2626                        unlink( $file );
     
    384384                }
    385385
    386386                $orig_file = DIR_TESTDATA . '/images/wordpress-gsoc-flyer.pdf';
    387                 $test_file = '/tmp/wordpress-gsoc-flyer.pdf';
     387                $test_file = DIR_TEST_TMP . 'wordpress-gsoc-flyer.pdf';
    388388                copy( $orig_file, $test_file );
    389389
    390390                $attachment_id = $this->factory->attachment->create_object(
     
    429429
    430430                unlink( $test_file );
    431431                foreach ( $metadata['sizes'] as $size ) {
    432                         unlink( '/tmp/' . $size['file'] );
     432                        unlink( DIR_TEST_TMP . $size['file'] );
    433433                }
    434434        }
    435435
     
    442442                }
    443443
    444444                $orig_file = DIR_TESTDATA . '/images/wordpress-gsoc-flyer.pdf';
    445                 $test_file = '/tmp/wordpress-gsoc-flyer.pdf';
     445                $test_file = DIR_TEST_TMP . 'wordpress-gsoc-flyer.pdf';
    446446                copy( $orig_file, $test_file );
    447447
    448448                $attachment_id = $this->factory->attachment->create_object(
     
    472472
    473473                unlink( $test_file );
    474474                foreach ( $metadata['sizes'] as $size ) {
    475                         unlink( '/tmp/' . $size['file'] );
     475                        unlink( DIR_TEST_TMP . $size['file'] );
    476476                }
    477477        }
    478478
     
    494494                }
    495495
    496496                // Dummy JPEGs.
    497                 $jpg1_path = '/tmp/test.jpg'; // Straight.
     497                $jpg1_path = DIR_TEST_TMP . 'test.jpg'; // Straight.
    498498                file_put_contents( $jpg1_path, 'asdf' );
    499                 $jpg2_path = '/tmp/test-pdf.jpg'; // With PDF marker.
     499                $jpg2_path = DIR_TEST_TMP . 'test-pdf.jpg'; // With PDF marker.
    500500                file_put_contents( $jpg2_path, 'fdsa' );
    501501
    502502                // PDF with same name as JPEG.
    503                 $pdf_path = '/tmp/test.pdf';
     503                $pdf_path = DIR_TEST_TMP . 'test.pdf';
    504504                copy( DIR_TESTDATA . '/images/wordpress-gsoc-flyer.pdf', $pdf_path );
    505505
    506506                $attachment_id = $this->factory->attachment->create_object(
     
    510510                );
    511511
    512512                $metadata     = wp_generate_attachment_metadata( $attachment_id, $pdf_path );
    513                 $preview_path = '/tmp/' . $metadata['sizes']['full']['file'];
     513                $preview_path = DIR_TEST_TMP . $metadata['sizes']['full']['file'];
    514514
    515515                // PDF preview didn't overwrite PDF.
    516516                $this->assertNotEquals( $pdf_path, $preview_path );
     
    526526                unlink( $jpg2_path );
    527527                unlink( $pdf_path );
    528528                foreach ( $metadata['sizes'] as $size ) {
    529                         unlink( '/tmp/' . $size['file'] );
     529                        unlink( DIR_TEST_TMP . $size['file'] );
    530530                }
    531531        }
    532532}
  • tests/phpunit/includes/bootstrap.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    3737define( 'WP_TESTS_TABLE_PREFIX', $table_prefix );
    3838define( 'DIR_TESTDATA', dirname( __FILE__ ) . '/../data' );
    3939
     40if ( defined( 'PHP_OS' ) && 'win' == strtolower( substr( PHP_OS, 0, 3 ) ) ) {
     41        define( 'DIR_TEST_TMP', 'C:/Windows/Temp/' );
     42}
     43else {
     44        define( 'DIR_TEST_TMP', '/tmp/' );
     45}
     46
    4047define( 'WP_LANG_DIR', DIR_TESTDATA . '/languages' );
    4148
    4249if ( ! defined( 'WP_TESTS_FORCE_KNOWN_BUGS' ) ) {
  • tests/phpunit/tests/rest-api/rest-attachments-controller.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    6868                $role->add_cap( 'level_0' );
    6969
    7070                $orig_file       = DIR_TESTDATA . '/images/canola.jpg';
    71                 $this->test_file = '/tmp/canola.jpg';
     71                $this->test_file = DIR_TEST_TMP . 'canola.jpg';
    7272                copy( $orig_file, $this->test_file );
    7373                $orig_file2       = DIR_TESTDATA . '/images/codeispoetry.png';
    74                 $this->test_file2 = '/tmp/codeispoetry.png';
     74                $this->test_file2 = DIR_TEST_TMP . 'codeispoetry.png';
    7575                copy( $orig_file2, $this->test_file2 );
    7676        }
    7777