Make WordPress Core

Changeset 51415


Ignore:
Timestamp:
07/13/2021 10:43:42 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Tests: Clean up skipping conditions and requirements for various tests.

This improves the consistency of test skipping and ensures that:

  • The @requires annotations use the right condition and format, and are on the right level (class vs. function).
  • Inline conditions with a markTestSkipped() call are only used when annotations cannot be used.
  • All markTestSkipped() calls contain a verbose explanation of why the test is being skipped.

Props jrf, hellofromTonya.
Fixes #53009.

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

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/ajax/MediaEdit.php

    r49069 r51415  
    1212 * @since      3.5.0
    1313 * @group      ajax
     14 *
     15 * @requires   function imagejpeg
    1416 */
    1517class Tests_Ajax_MediaEdit extends WP_Ajax_UnitTestCase {
    … …  
    2628        /**
    2729         * @ticket 22985
    28          * @requires function imagejpeg
    2930         */
    3031        public function testCropImageThumbnail() {
    … …  
    5657        /**
    5758         * @ticket 32171
    58          * @requires function imagejpeg
    5959         */
    6060        public function testImageEditOverwriteConstant() {
  • trunk/tests/phpunit/tests/cache.php

    r50610 r51415  
    252252        function test_switch_to_blog() {
    253253                if ( ! method_exists( $this->cache, 'switch_to_blog' ) ) {
    254                         return;
     254                        $this->markTestSkipped( 'This test requires a switch_to_blog() method on the cache object.' );
    255255                }
    256256
  • trunk/tests/phpunit/tests/compat.php

    r48996 r51415  
    243243         *
    244244         * @ticket 43583
     245         *
     246         * @requires extension intl
    245247         */
    246248        function test_is_countable_ResourceBundle() {
    247                 if ( ! class_exists( 'ResourceBundle' ) ) {
    248                         $this->markTestSkipped( 'The intl extension is not loaded. ResourceBundle not tested for is_countable().' );
    249                 }
    250 
    251249                $this->assertTrue( is_countable( new ResourceBundle( 'en', null ) ) );
    252250        }
    … …  
    256254         *
    257255         * @ticket 43583
     256         *
     257         * @requires extension simplexml
    258258         */
    259259        function test_is_countable_SimpleXMLElement() {
    260                 if ( ! class_exists( 'SimpleXMLElement' ) ) {
    261                         $this->markTestSkipped( 'The xml extension is not loaded. SimpleXMLElement not tested for is_countable().' );
    262                 }
    263 
    264260                $this->assertTrue( is_countable( new SimpleXMLElement( '<xml><tag>1</tag><tag>2</tag></xml>' ) ) );
    265261        }
  • trunk/tests/phpunit/tests/customize/manager.php

    r51331 r51415  
    542542         * @covers WP_Customize_Manager::import_theme_starter_content
    543543         * @covers WP_Customize_Manager::_save_starter_content_changeset
     544         * @requires function imagejpeg
    544545         */
    545546        function test_import_theme_starter_content() {
  • trunk/tests/phpunit/tests/db/charset.php

    r50286 r51415  
    763763                if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
    764764                        $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
    765                         return;
    766765                }
    767766
    … …  
    805804                if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
    806805                        $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
    807                         return;
    808806                }
    809807
    … …  
    829827                if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
    830828                        $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
    831                         return;
    832829                }
    833830
    … …  
    857854                if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
    858855                        $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
    859                         return;
    860856                }
    861857
    … …  
    918914                if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
    919915                        $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
    920                         return;
    921916                }
    922917
  • trunk/tests/phpunit/tests/functions/anonymization.php

    r49025 r51415  
    2626         * @ticket 41083
    2727         * @ticket 43545
    28          * @requires function inet_ntop
    29          * @requires function inet_pton
    3028         *
    3129         * @param string $raw_ip          Raw IP address.
    … …  
    9189                                '::',
    9290                        ),
    93                         // Malformed string with valid IP substring. Sometimes proxies add things like this, or other arbitrary strings.
    94                         array(
    95                                 'or=\"[1000:0000:0000:0000:0000:0000:0000:0001]:400',
    96                                 '1000::',
    97                         ),
    98                         // Malformed string with valid IP substring. Sometimes proxies add things like this, or other arbitrary strings.
    99                         array(
    100                                 'or=\"[1000:0000:0000:0000:0000:0000:0000:0001]',
    101                                 '1000::',
    102                         ),
    103                         // Malformed string with valid IP substring. Sometimes proxies add things like this, or other arbitrary strings.
    104                         array(
    105                                 'or=\"[1000:0000:0000:0000:0000:0000:0000:0001]400',
    106                                 '1000::',
    107                         ),
    108                         // Malformed string with valid IP substring. Sometimes proxies add things like this, or other arbitrary strings.
    109                         array(
    110                                 '[1000:0000:0000:0000:0000:0000:0000:0001]:235\"or=',
    111                                 '1000::',
    112                         ),
    11391                        // IPv4, no port.
    11492                        array(
    … …  
    126104                                '10.20.30.0',
    127105                        ),
     106                        // IPv6, no port, reducible representation.
     107                        array(
     108                                '0000:0000:0000:0000:0000:0000:0000:0001',
     109                                '::',
     110                        ),
     111                        // IPv6, port, reducible representation.
     112                        array(
     113                                '[0000:0000:0000:0000:0000:0000:0000:0001]:1234',
     114                                '::',
     115                        ),
     116                        // IPv6, no port, reduced representation.
     117                        array(
     118                                '::',
     119                                '::',
     120                        ),
     121                        // IPv6, no port, reduced representation.
     122                        array(
     123                                '::1',
     124                                '::',
     125                        ),
     126                        // IPv6, port, reduced representation.
     127                        array(
     128                                '[::]:20000',
     129                                '::',
     130                        ),
     131                        // IPv6, address brackets without port delimiter and number, reduced representation.
     132                        array(
     133                                '[::1]',
     134                                '::',
     135                        ),
     136                        // IPv6, no port, compatibility mode.
     137                        array(
     138                                '::ffff:10.15.20.25',
     139                                '::ffff:10.15.20.0',
     140                        ),
     141                        // IPv6, port, compatibility mode.
     142                        array(
     143                                '[::FFFF:10.15.20.25]:30000',
     144                                '::ffff:10.15.20.0',
     145                        ),
     146                        // IPv6, no port, compatibility mode shorthand.
     147                        array(
     148                                '::127.0.0.1',
     149                                '::ffff:127.0.0.0',
     150                        ),
     151                        // IPv6, port, compatibility mode shorthand.
     152                        array(
     153                                '[::127.0.0.1]:30000',
     154                                '::ffff:127.0.0.0',
     155                        ),
     156                );
     157        }
     158
     159        /**
     160         * Test that wp_privacy_anonymize_ip() properly anonymizes all possible IP address formats.
     161         *
     162         * @dataProvider data_wp_privacy_anonymize_ip_with_inet_dependency
     163         *
     164         * @ticket 41083
     165         * @ticket 43545
     166         * @requires function inet_ntop
     167         * @requires function inet_pton
     168         *
     169         * @param string $raw_ip          Raw IP address.
     170         * @param string $expected_result Expected result.
     171         */
     172        public function test_wp_privacy_anonymize_ip_with_inet_dependency( $raw_ip, $expected_result ) {
     173                $this->test_wp_privacy_anonymize_ip( $raw_ip, $expected_result );
     174        }
     175
     176        /**
     177         * Provide test cases for `test_wp_privacy_anonymize_ip()`.
     178         *
     179         * @since 4.9.6 Moved from `Test_WP_Community_Events::data_get_unsafe_client_ip_anonymization()`.
     180         *
     181         * @return array {
     182         *     @type array {
     183         *         @string string $raw_ip          Raw IP address.
     184         *         @string string $expected_result Expected result.
     185         *     }
     186         * }
     187         */
     188        public function data_wp_privacy_anonymize_ip_with_inet_dependency() {
     189                return array(
     190                        // Malformed string with valid IP substring. Sometimes proxies add things like this, or other arbitrary strings.
     191                        array(
     192                                'or=\"[1000:0000:0000:0000:0000:0000:0000:0001]:400',
     193                                '1000::',
     194                        ),
     195                        // Malformed string with valid IP substring. Sometimes proxies add things like this, or other arbitrary strings.
     196                        array(
     197                                'or=\"[1000:0000:0000:0000:0000:0000:0000:0001]',
     198                                '1000::',
     199                        ),
     200                        // Malformed string with valid IP substring. Sometimes proxies add things like this, or other arbitrary strings.
     201                        array(
     202                                'or=\"[1000:0000:0000:0000:0000:0000:0000:0001]400',
     203                                '1000::',
     204                        ),
     205                        // Malformed string with valid IP substring. Sometimes proxies add things like this, or other arbitrary strings.
     206                        array(
     207                                '[1000:0000:0000:0000:0000:0000:0000:0001]:235\"or=',
     208                                '1000::',
     209                        ),
    128210                        // IPv6, no port.
    129211                        array(
    … …  
    136218                                '2a03:2880:2110:df07::',
    137219                        ),
    138                         // IPv6, no port, reducible representation.
    139                         array(
    140                                 '0000:0000:0000:0000:0000:0000:0000:0001',
    141                                 '::',
    142                         ),
    143220                        // IPv6, no port, partially reducible representation.
    144221                        array(
    … …  
    146223                                '1000::',
    147224                        ),
    148                         // IPv6, port, reducible representation.
    149                         array(
    150                                 '[0000:0000:0000:0000:0000:0000:0000:0001]:1234',
    151                                 '::',
    152                         ),
    153225                        // IPv6, port, partially reducible representation.
    154226                        array(
    155227                                '[1000:0000:0000:0000:0000:0000:0000:0001]:5678',
    156228                                '1000::',
    157                         ),
    158                         // IPv6, no port, reduced representation.
    159                         array(
    160                                 '::',
    161                                 '::',
    162                         ),
    163                         // IPv6, no port, reduced representation.
    164                         array(
    165                                 '::1',
    166                                 '::',
    167                         ),
    168                         // IPv6, port, reduced representation.
    169                         array(
    170                                 '[::]:20000',
    171                                 '::',
    172                         ),
    173                         // IPv6, address brackets without port delimiter and number, reduced representation.
    174                         array(
    175                                 '[::1]',
    176                                 '::',
    177                         ),
    178                         // IPv6, no port, compatibility mode.
    179                         array(
    180                                 '::ffff:10.15.20.25',
    181                                 '::ffff:10.15.20.0',
    182                         ),
    183                         // IPv6, port, compatibility mode.
    184                         array(
    185                                 '[::FFFF:10.15.20.25]:30000',
    186                                 '::ffff:10.15.20.0',
    187                         ),
    188                         // IPv6, no port, compatibility mode shorthand.
    189                         array(
    190                                 '::127.0.0.1',
    191                                 '::ffff:127.0.0.0',
    192                         ),
    193                         // IPv6, port, compatibility mode shorthand.
    194                         array(
    195                                 '[::127.0.0.1]:30000',
    196                                 '::ffff:127.0.0.0',
    197229                        ),
    198230                        // IPv6 with reachability scope.
  • trunk/tests/phpunit/tests/general/template.php

    r51331 r51415  
    3636         * @group site_icon
    3737         * @covers ::get_site_icon_url
     38         * @requires function imagejpeg
    3839         */
    3940        function test_get_site_icon_url() {
    … …  
    5051         * @group site_icon
    5152         * @covers ::site_icon_url
     53         * @requires function imagejpeg
    5254         */
    5355        function test_site_icon_url() {
    … …  
    6365         * @group site_icon
    6466         * @covers ::has_site_icon
     67         * @requires function imagejpeg
    6568         */
    6669        function test_has_site_icon() {
    … …  
    104107         * @group site_icon
    105108         * @covers ::wp_site_icon
     109         * @requires function imagejpeg
    106110         */
    107111        function test_wp_site_icon() {
    … …  
    126130         * @group site_icon
    127131         * @covers ::wp_site_icon
     132         * @requires function imagejpeg
    128133         */
    129134        function test_wp_site_icon_with_filter() {
  • trunk/tests/phpunit/tests/http/base.php

    r51403 r51415  
    2121                parent::setUp();
    2222
    23                 if ( is_callable( array( 'WP_Http', '_getTransport' ) ) ) {
    24                         $this->markTestSkipped( 'The WP_Http tests require a class-http.php file of r17550 or later.' );
    25                         return;
    26                 }
    27 
    2823                $class = 'WP_Http_' . ucfirst( $this->transport );
    2924                if ( ! call_user_func( array( $class, 'test' ) ) ) {
  • trunk/tests/phpunit/tests/http/functions.php

    r51331 r51415  
    44 * @group http
    55 * @group external-http
    6  * @requires extension openssl
    76 */
    87class Tests_HTTP_Functions extends WP_UnitTestCase {
  • trunk/tests/phpunit/tests/image/editorGd.php

    r50491 r51415  
    5454        /**
    5555         * Test resizing an image, not using crop
     56         *
     57         * @requires function imagejpeg
    5658         */
    5759        public function test_resize() {
    … …  
    7476        /**
    7577         * Test multi_resize with single image resize and no crop
     78         *
     79         * @requires function imagejpeg
    7680         */
    7781        public function test_single_multi_resize() {
    … …  
    184188         *
    185189         * @ticket 26823
     190         * @requires function imagejpeg
    186191         */
    187192        public function test_multi_resize() {
  • trunk/tests/phpunit/tests/image/functions.php

    r51397 r51415  
    173173         */
    174174        public function test_wp_save_image_file() {
    175                 $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
    176 
    177                 foreach ( $classes as $key => $class ) {
    178                         if ( ! call_user_func( array( $class, 'test' ) ) ) {
    179                                 // If the image editor isn't available, skip it.
    180                                 unset( $classes[ $key ] );
    181                         }
    182                 }
    183 
    184                 if ( ! $classes ) {
    185                         $this->markTestSkipped( sprintf( 'The image editor engine %s is not supported on this system.', 'WP_Image_Editor_GD' ) );
    186                 }
     175                $classes = $this->get_image_editor_engine_classes();
    187176
    188177                require_once ABSPATH . 'wp-admin/includes/image-edit.php';
    … …  
    234223         */
    235224        public function test_mime_overrides_filename() {
    236                 $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
    237 
    238                 foreach ( $classes as $key => $class ) {
    239                         if ( ! call_user_func( array( $class, 'test' ) ) ) {
    240                                 // If the image editor isn't available, skip it.
    241                                 unset( $classes[ $key ] );
    242                         }
    243                 }
    244 
    245                 if ( ! $classes ) {
    246                         $this->markTestSkipped( sprintf( 'The image editor engine %s is not supported on this system.', 'WP_Image_Editor_GD' ) );
    247                 }
     225                $classes = $this->get_image_editor_engine_classes();
    248226
    249227                // Test each image editor engine.
    … …  
    276254         */
    277255        public function test_inferred_mime_types() {
    278                 $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
    279 
    280                 foreach ( $classes as $key => $class ) {
    281                         if ( ! call_user_func( array( $class, 'test' ) ) ) {
    282                                 // If the image editor isn't available, skip it.
    283                                 unset( $classes[ $key ] );
    284                         }
    285                 }
    286 
    287                 if ( ! $classes ) {
    288                         $this->markTestSkipped( sprintf( 'The image editor engine %s is not supported on this system.', 'WP_Image_Editor_GD' ) );
    289                 }
     256                $classes = $this->get_image_editor_engine_classes();
    290257
    291258                // Mime types.
    … …  
    343310                $this->assertInstanceOf( 'WP_Error', $editor2 );
    344311
     312                $classes = $this->get_image_editor_engine_classes();
     313
     314                // Then, test with editors.
     315                foreach ( $classes as $class ) {
     316                        $editor = new $class( DIR_TESTDATA );
     317                        $loaded = $editor->load();
     318
     319                        $this->assertInstanceOf( 'WP_Error', $loaded );
     320                        $this->assertSame( 'error_loading_image', $loaded->get_error_code() );
     321                }
     322        }
     323
     324        /**
     325         * Get the available image editor engine class(es).
     326         *
     327         * @return string[] Available image editor classes; empty array when none are avaialble.
     328         */
     329        private function get_image_editor_engine_classes() {
    345330                $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
    346331
    … …  
    352337                }
    353338
    354                 if ( ! $classes ) {
    355                         $this->markTestSkipped( sprintf( 'The image editor engine %s is not supported on this system.', 'WP_Image_Editor_GD' ) );
    356                 }
    357 
    358                 // Then, test with editors.
    359                 foreach ( $classes as $class ) {
    360                         $editor = new $class( DIR_TESTDATA );
    361                         $loaded = $editor->load();
    362 
    363                         $this->assertInstanceOf( 'WP_Error', $loaded );
    364                         $this->assertSame( 'error_loading_image', $loaded->get_error_code() );
    365                 }
     339                if ( empty( $classes ) ) {
     340                        $this->markTestSkipped( 'Image editor engines WP_Image_Editor_GD and WP_Image_Editor_Imagick are not supported on this system.' );
     341                }
     342
     343                return $classes;
    366344        }
    367345
  • trunk/tests/phpunit/tests/image/intermediateSize.php

    r51397 r51415  
    157157        /**
    158158         * @ticket 17626
     159         * @requires function imagejpeg
    159160         */
    160161        function test_get_intermediate_sizes_by_array_nearest_false() {
  • trunk/tests/phpunit/tests/image/resizeGd.php

    r50449 r51415  
    66 * @group upload
    77 * @group resize
     8 *
     9 * @requires function imagejpeg
    810 */
    911require_once __DIR__ . '/resize.php';
  • trunk/tests/phpunit/tests/l10n/getLocale.php

    r49027 r51415  
    4040        public function test_network_option_should_be_fallback_on_multisite() {
    4141                if ( ! is_multisite() ) {
    42                         $this->markTestSkipped( __METHOD__ . ' requires Multisite.' );
     42                        $this->markTestSkipped( 'This test requires Multisite.' );
    4343                }
    4444
    … …  
    6060        public function test_option_should_be_respected_on_nonmultisite() {
    6161                if ( is_multisite() ) {
    62                         $this->markTestSkipped( __METHOD__ . ' does not apply to Multisite.' );
     62                        $this->markTestSkipped( 'This test does not apply to Multisite.' );
    6363                }
    6464
  • trunk/tests/phpunit/tests/l10n/getUserLocale.php

    r50463 r51415  
    7373        public function test_user_locale_is_same_across_network() {
    7474                if ( ! is_multisite() ) {
    75                         $this->markTestSkipped( __METHOD__ . ' requires Multisite.' );
     75                        $this->markTestSkipped( 'This test requires Multisite.' );
    7676                }
    7777
  • trunk/tests/phpunit/tests/media.php

    r51397 r51415  
    17231723        /**
    17241724         * @ticket 33641
     1725         * @requires function imagejpeg
    17251726         */
    17261727        function test_wp_calculate_image_srcset_no_width() {
  • trunk/tests/phpunit/tests/pomo/mo.php

    r51367 r51415  
    180180        function test_overloaded_mb_functions() {
    181181                if ( ( ini_get( 'mbstring.func_overload' ) & 2 ) === 0 ) {
    182                         $this->markTestSkipped( __METHOD__ . ' only runs when mbstring.func_overload is enabled.' );
     182                        $this->markTestSkipped( 'This test requires mbstring.func_overload to be enabled.' );
    183183                }
    184184
  • trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php

    r51404 r51415  
    744744        }
    745745
     746        /**
     747         * @requires function imagejpeg
     748         */
    746749        public function test_create_item() {
    747750                wp_set_current_user( self::$author_id );
    … …  
    793796        }
    794797
     798        /**
     799         * @requires function imagejpeg
     800         */
    795801        public function test_create_item_with_files() {
    796802                wp_set_current_user( self::$author_id );
    … …  
    811817        }
    812818
     819        /**
     820         * @requires function imagejpeg
     821         */
    813822        public function test_create_item_with_upload_files_role() {
    814823                wp_set_current_user( self::$uploader_id );
    … …  
    925934        }
    926935
     936        /**
     937         * @requires function imagejpeg
     938         */
    927939        public function test_create_item_alt_text() {
    928940                wp_set_current_user( self::$author_id );
    … …  
    938950        }
    939951
     952        /**
     953         * @requires function imagejpeg
     954         */
    940955        public function test_create_item_unsafe_alt_text() {
    941956                wp_set_current_user( self::$author_id );
    … …  
    952967        /**
    953968         * @ticket 40861
     969         * @requires function imagejpeg
    954970         */
    955971        public function test_create_item_ensure_relative_path() {
    … …  
    12751291        /**
    12761292         * @dataProvider attachment_roundtrip_provider
     1293         * @requires function imagejpeg
    12771294         */
    12781295        public function test_post_roundtrip_as_author( $raw, $expected ) {
    … …  
    12821299        }
    12831300
     1301        /**
     1302         * @requires function imagejpeg
     1303         */
    12841304        public function test_attachment_roundtrip_as_editor_unfiltered_html() {
    12851305                wp_set_current_user( self::$editor_id );
    … …  
    13331353        }
    13341354
     1355        /**
     1356         * @requires function imagejpeg
     1357         */
    13351358        public function test_attachment_roundtrip_as_superadmin_unfiltered_html() {
    13361359                wp_set_current_user( self::$superadmin_id );
    … …  
    18091832         *
    18101833         * @ticket 45269
     1834         * @requires function imagejpeg
    18111835         */
    18121836        public function test_rest_insert_attachment_hooks_fire_once_on_create() {
    … …  
    18661890        /**
    18671891         * @ticket 44567
     1892         * @requires function imagejpeg
    18681893         */
    18691894        public function test_create_item_with_meta_values() {
    … …  
    19031928        /**
    19041929         * @ticket 44405
     1930         * @requires function imagejpeg
    19051931         */
    19061932        public function test_edit_image_returns_error_if_logged_out() {
    … …  
    19151941        /**
    19161942         * @ticket 44405
     1943         * @requires function imagejpeg
    19171944         */
    19181945        public function test_edit_image_returns_error_if_cannot_upload() {
    … …  
    19311958        /**
    19321959         * @ticket 44405
     1960         * @requires function imagejpeg
    19331961         */
    19341962        public function test_edit_image_returns_error_if_cannot_edit() {
    … …  
    19571985        /**
    19581986         * @ticket 44405
     1987         * @requires function imagejpeg
    19591988         */
    19601989        public function test_edit_image_returns_error_if_unsupported_mime_type() {
    … …  
    19762005        /**
    19772006         * @ticket 44405
     2007         * @requires function imagejpeg
    19782008         */
    19792009        public function test_edit_image_returns_error_if_no_edits() {
    … …  
    19892019        /**
    19902020         * @ticket 44405
     2021         * @requires function imagejpeg
    19912022         */
    19922023        public function test_edit_image_rotate() {
    … …  
    20132044        /**
    20142045         * @ticket 44405
     2046         * @requires function imagejpeg
    20152047         */
    20162048        public function test_edit_image_crop() {
    … …  
    21192151        /**
    21202152         * @ticket 50565
     2153         * @requires function imagejpeg
    21212154         */
    21222155        public function test_edit_image_returns_error_if_mismatched_src() {
  • trunk/tests/phpunit/tests/url.php

    r50156 r51415  
    274274
    275275        function test_set_url_scheme() {
    276                 if ( ! function_exists( 'set_url_scheme' ) ) {
    277                         return;
    278                 }
    279 
    280276                $links = array(
    281277                        'http://wordpress.org/',
  • trunk/tests/phpunit/tests/widgets/media-gallery-widget.php

    r49193 r51415  
    5353         *
    5454         * @covers WP_Widget_Media_Gallery::render_media
     55         * @requires function imagejpeg
    5556         */
    5657        public function test_render_media() {
  • trunk/tests/phpunit/tests/widgets/media-widget.php

    r51331 r51415  
    9696                $this->assertSame( $name, $widget->name );
    9797
    98                 // Method assertArraySubset doesn't exist in phpunit versions compatible with PHP 5.2.
    99                 if ( method_exists( $this, 'assertArraySubset' ) ) {
    100                         $this->assertArraySubset( $widget_options, $widget->widget_options );
    101                         $this->assertArraySubset( $control_options, $widget->control_options );
    102                 }
     98                $this->assertArraySubset( $widget_options, $widget->widget_options );
     99                $this->assertArraySubset( $control_options, $widget->control_options );
    103100        }
    104101
    … …  
    136133         *
    137134         * @covers WP_Widget_Media::is_attachment_with_mime_type
     135         * @requires function imagejpeg
    138136         */
    139137        function test_is_attachment_with_mime_type() {
  • trunk/tests/phpunit/tests/xmlrpc/mw/editPost.php

    r48937 r51415  
    133133        }
    134134
     135        /**
     136         * @requires function imagejpeg
     137         */
    135138        function test_post_thumbnail() {
    136139                add_theme_support( 'post-thumbnails' );
  • trunk/tests/phpunit/tests/xmlrpc/mw/getPost.php

    r51331 r51415  
    9090        }
    9191
     92        /**
     93         * @requires function imagejpeg
     94         */
    9295        function test_post_thumbnail() {
    9396                add_theme_support( 'post-thumbnails' );
  • trunk/tests/phpunit/tests/xmlrpc/mw/getRecentPosts.php

    r51367 r51415  
    9595        }
    9696
     97        /**
     98         * @requires function imagejpeg
     99         */
    97100        function test_post_thumbnail() {
    98101                add_theme_support( 'post-thumbnails' );
  • trunk/tests/phpunit/tests/xmlrpc/mw/newPost.php

    r48937 r51415  
    129129        }
    130130
     131        /**
     132         * @requires function imagejpeg
     133         */
    131134        function test_post_thumbnail() {
    132135                add_theme_support( 'post-thumbnails' );
  • trunk/tests/phpunit/tests/xmlrpc/wp/editPost.php

    r51404 r51415  
    133133        }
    134134
     135        /**
     136         * @requires function imagejpeg
     137         */
    135138        function test_post_thumbnail() {
    136139                add_theme_support( 'post-thumbnails' );
  • trunk/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php

    r51331 r51415  
    33/**
    44 * @group xmlrpc
     5 * @requires function imagejpeg
    56 */
    67class Tests_XMLRPC_wp_getMediaItem extends WP_XMLRPC_UnitTestCase {
  • trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php

    r51331 r51415  
    146146        }
    147147
     148        /**
     149         * @requires function imagejpeg
     150         */
    148151        function test_post_thumbnail() {
    149152                add_theme_support( 'post-thumbnails' );
  • trunk/tests/phpunit/tests/xmlrpc/wp/uploadFile.php

    r51331 r51415  
    33/**
    44 * @group xmlrpc
     5 * @requires function imagejpeg
    56 */
    67class Tests_XMLRPC_wp_uploadFile extends WP_XMLRPC_UnitTestCase {
Note: See TracChangeset for help on using the changeset viewer.