WordPress.org

Make WordPress Core

Changeset 38761


Ignore:
Timestamp:
10/08/16 22:42:12 (10 months ago)
Author:
johnbillion
Message:

Build/Test Tools: Revert [38759]. PHPUnit's @requires syntax was introduced in PHPUnit 3.7, but the tests for PHP 5.2 use PHPUnit 3.6 because it's the latest version that supports PHP 5.2.

Fixes #38256

Location:
trunk/tests/phpunit/tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/http/functions.php

    r38759 r38761  
    44 * @group http 
    55 * @group external-http 
    6  * 
    7  * @requires extension openssl 
    86 */ 
    97class Tests_HTTP_Functions extends WP_UnitTestCase { 
     8    public function setUp() { 
     9        if ( ! extension_loaded( 'openssl' ) ) { 
     10            $this->markTestSkipped( 'Tests_HTTP_Functions requires openssl.' ); 
     11        } 
     12 
     13        parent::setUp(); 
     14    } 
    1015 
    1116    function test_head_request() { 
  • trunk/tests/phpunit/tests/image/functions.php

    r38759 r38761  
    109109     * Test save image file and mime_types 
    110110     * @ticket 6821 
    111      * 
    112      * @requires extension fileinfo 
    113111     */ 
    114112    public function test_wp_save_image_file() { 
     113        if ( ! extension_loaded( 'fileinfo' ) ) { 
     114            $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' ); 
     115        } 
     116 
    115117        include_once( ABSPATH . 'wp-admin/includes/image-edit.php' ); 
    116118 
     
    159161     * Test that a passed mime type overrides the extension in the filename 
    160162     * @ticket 6821 
    161      * 
    162      * @requires extension fileinfo 
    163163     */ 
    164164    public function test_mime_overrides_filename() { 
     165        if ( ! extension_loaded( 'fileinfo' ) ) { 
     166            $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' ); 
     167        } 
     168 
    165169        // Test each image editor engine 
    166170        $classes = array('WP_Image_Editor_GD', 'WP_Image_Editor_Imagick'); 
     
    195199     * Test that mime types are correctly inferred from file extensions 
    196200     * @ticket 6821 
    197      * 
    198      * @requires extension fileinfo 
    199201     */ 
    200202    public function test_inferred_mime_types() { 
     203        if ( ! extension_loaded( 'fileinfo' ) ) { 
     204            $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' ); 
     205        } 
     206 
    201207        // Mime types 
    202208        $mime_types = array( 
     
    291297    } 
    292298 
    293     /** 
    294      * @requires extension openssl 
    295      * @requires function imagejpeg 
    296      */ 
    297299    public function test_wp_crop_image_url() { 
     300        if ( !function_exists( 'imagejpeg' ) ) 
     301            $this->markTestSkipped( 'jpeg support unavailable' ); 
     302 
     303        if ( ! extension_loaded( 'openssl' ) ) { 
     304            $this->markTestSkipped( 'Tests_Image_Functions::test_wp_crop_image_url() requires openssl.' ); 
     305        } 
     306 
    298307        $file = wp_crop_image( 'https://asdftestblog1.files.wordpress.com/2008/04/canola.jpg', 
    299308                              0, 0, 100, 100, 100, 100, false, 
     
    315324    } 
    316325 
    317     /** 
    318      * @requires extension openssl 
    319      */ 
    320326    public function test_wp_crop_image_url_not_exist() { 
     327        if ( ! extension_loaded( 'openssl' ) ) { 
     328            $this->markTestSkipped( 'Tests_Image_Functions::test_wp_crop_image_url_not_exist() requires openssl.' ); 
     329        } 
     330 
    321331        $file = wp_crop_image( 'https://asdftestblog1.files.wordpress.com/2008/04/canoladoesnotexist.jpg', 
    322332                              0, 0, 100, 100, 100, 100 ); 
  • trunk/tests/phpunit/tests/image/meta.php

    r38759 r38761  
    55 * @group media 
    66 * @group upload 
    7  * 
    8  * @requires extension gd 
    9  * @requires extension exif 
    107 */ 
    118class Tests_Image_Meta extends WP_UnitTestCase { 
     9    function setUp() { 
     10        if ( ! extension_loaded( 'gd' ) ) 
     11            $this->markTestSkipped( 'The gd PHP extension is not loaded.' ); 
     12        if ( ! extension_loaded( 'exif' ) ) 
     13            $this->markTestSkipped( 'The exif PHP extension is not loaded.' ); 
     14        if ( ! is_callable( 'wp_read_image_metadata' ) ) 
     15            $this->markTestSkipped( 'wp_read_image_metadata() is not callable.' ); 
     16        parent::setUp(); 
     17    } 
    1218 
    1319    function test_exif_d70() { 
Note: See TracChangeset for help on using the changeset viewer.