Make WordPress Core


Ignore:
Timestamp:
02/20/2020 05:04:42 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Fix the Travis CI build for the 3.9 branch.

Among other fixes, this backports [28943], [28961], [28964-28968], [28988], [29120], [29251], [29503], [29860], [29869], [29954], [30001], [30160], [30282], [30285], [30289-30291], [30513-30514], [30516-30521], [30523-30524], [30526], [30529-30530], [31253-31254], [31257-31259], [31622], [33374], [40255], [40257], [40259], [40269], [40271], [40446], [40449], [40457], [40604], [40538], [40833], [41082], [41303], [41306], [44993].

See #49485.

Location:
branches/3.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.9

  • branches/3.9/tests/phpunit/tests/media.php

    r39717 r47329  
    124124
    125125        $out = wp_oembed_get( 'http://www.youtube.com/watch?v=oHg5SJYRHA0' );
    126         $this->assertContains( 'http://www.youtube.com/embed/oHg5SJYRHA0?feature=oembed', $out );
     126        $this->assertContains( 'https://www.youtube.com/embed/oHg5SJYRHA0?feature=oembed', $out );
    127127
    128128        $out = wp_oembed_get( 'https://www.youtube.com/watch?v=oHg5SJYRHA0' );
     
    457457        );
    458458
    459         $post_id = media_handle_upload( 'upload', 0, array(), array( 'action' => 'test_upload_titles', 'test_form' => false ) );
     459        $post_id = media_handle_upload(
     460            'upload',
     461            0,
     462            array(),
     463            array(
     464                'action'               => 'test_upload_titles',
     465                'test_form'            => false,
     466                /*
     467                 * This test previously failed on WP < 4.0 due to is_uploaded_file()
     468                 * and move_uploaded_file() usage in wp_handle_upload().
     469                 *
     470                 * Since successful upload is irrelevant for the purpose of this test,
     471                 * discarding upload errors allows the test to proceed.
     472                 */
     473                'upload_error_handler' => array( $this, '_discard_upload_errors' ),
     474            )
     475        );
    460476
    461477        unset( $_FILES['upload'] );
     
    467483
    468484        $this->assertEquals( 'This is a test', $post->post_title );
     485    }
     486
     487    function _discard_upload_errors( &$file, $message ) {
     488        $uploads  = wp_upload_dir();
     489        $filename = wp_unique_filename( $uploads['path'], $file['name'] );
     490
     491        $new_file = $uploads['path'] . "/$filename";
     492        $url      = $uploads['url'] . "/$filename";
     493
     494        return array( 'file' => $new_file, 'url' => $url, 'type' => $file['type'] );
    469495    }
    470496
Note: See TracChangeset for help on using the changeset viewer.