Make WordPress Core

Changeset 35148


Ignore:
Timestamp:
10/13/2015 08:44:16 PM (9 years ago)
Author:
ocean90
Message:

Improve [35146] to only skip pluggable function signature tests for wp-includes/cache.php when an external object cache is in use.

See #31491, #33867.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/pluggable.php

    r35147 r35148  
    1515     */
    1616    public function testPluggableFunctionSignaturesMatch( $function ) {
    17 
    18         if ( wp_using_ext_object_cache() ) {
    19             // #31491
    20             $this->markTestSkipped( 'Pluggable function signatures are not tested when an external object cache is in use.' );
    21         }
    2217
    2318        $signatures = $this->getPluggableFunctionSignatures();
     
    9287        $test_files = array(
    9388            'wp-includes/pluggable.php',
    94             'wp-includes/cache.php',
    9589        );
     90
     91        // Pluggable function signatures are not tested when an external object cache is in use. #31491
     92        if ( ! wp_using_ext_object_cache() ) {
     93            $test_files[] = 'wp-includes/cache.php';
     94        }
     95
    9696        $data = array();
    9797
     
    123123    public function getPluggableFunctionSignatures() {
    124124
    125         return array(
     125        $signatures = array(
    126126
    127127            // wp-includes/pluggable.php:
     
    166166            'wp_text_diff'                    => array( 'left_string', 'right_string', 'args' => null ),
    167167
    168             // wp-includes/cache.php:
    169             'wp_cache_add'                       => array( 'key', 'data', 'group' => '', 'expire' => 0 ),
    170             'wp_cache_close'                     => array(),
    171             'wp_cache_decr'                      => array( 'key', 'offset' => 1, 'group' => '' ),
    172             'wp_cache_delete'                    => array( 'key', 'group' => '' ),
    173             'wp_cache_flush'                     => array(),
    174             'wp_cache_get'                       => array( 'key', 'group' => '', 'force' => false, 'found' => null ),
    175             'wp_cache_incr'                      => array( 'key', 'offset' => 1, 'group' => '' ),
    176             'wp_cache_init'                      => array(),
    177             'wp_cache_replace'                   => array( 'key', 'data', 'group' => '', 'expire' => 0 ),
    178             'wp_cache_set'                       => array( 'key', 'data', 'group' => '', 'expire' => 0 ),
    179             'wp_cache_switch_to_blog'            => array( 'blog_id' ),
    180             'wp_cache_add_global_groups'         => array( 'groups' ),
    181             'wp_cache_add_non_persistent_groups' => array( 'groups' ),
    182             'wp_cache_reset'                     => array(),
    183 
    184168            // wp-admin/includes/schema.php:
    185169            'install_network'                    => array(),
     
    191175            'wp_upgrade'                         => array(),
    192176            'install_global_terms'               => array(),
    193 
    194177        );
    195178
     179        // Pluggable function signatures are not tested when an external object cache is in use. #31491
     180        if ( ! wp_using_ext_object_cache() ) {
     181            $signatures = array_merge( $signatures, array(
     182
     183                // wp-includes/cache.php:
     184                'wp_cache_add'                       => array( 'key', 'data', 'group' => '', 'expire' => 0 ),
     185                'wp_cache_close'                     => array(),
     186                'wp_cache_decr'                      => array( 'key', 'offset' => 1, 'group' => '' ),
     187                'wp_cache_delete'                    => array( 'key', 'group' => '' ),
     188                'wp_cache_flush'                     => array(),
     189                'wp_cache_get'                       => array( 'key', 'group' => '', 'force' => false, 'found' => null ),
     190                'wp_cache_incr'                      => array( 'key', 'offset' => 1, 'group' => '' ),
     191                'wp_cache_init'                      => array(),
     192                'wp_cache_replace'                   => array( 'key', 'data', 'group' => '', 'expire' => 0 ),
     193                'wp_cache_set'                       => array( 'key', 'data', 'group' => '', 'expire' => 0 ),
     194                'wp_cache_switch_to_blog'            => array( 'blog_id' ),
     195                'wp_cache_add_global_groups'         => array( 'groups' ),
     196                'wp_cache_add_non_persistent_groups' => array( 'groups' ),
     197                'wp_cache_reset'                     => array(),
     198            ) );
     199        }
     200
     201        return $signatures;
    196202    }
    197203
Note: See TracChangeset for help on using the changeset viewer.