Make WordPress Core

Changeset 34765


Ignore:
Timestamp:
10/02/2015 05:05:26 AM (9 years ago)
Author:
wonderboymusic
Message:

Unit Tests: in Tests_Cache::test_wp_cache_init(), when wp_using_ext_object_cache(), just check that the global is an instance of WP_Object_Cache. External object cache instances of WP_Object_Cache will contain resources as props that will always have differing internal IDs, so strict comparison won't work.

See #31491.

File:
1 edited

Legend:

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

    r31622 r34765  
    282282
    283283        global $wp_object_cache;
    284         $this->assertEquals( $wp_object_cache, $new_blank_cache_object );
     284
     285        if ( wp_using_ext_object_cache() ) {
     286            // External caches will contain property values that contain non-matching resource IDs
     287            $this->assertInstanceOf( 'WP_Object_Cache', $wp_object_cache  );
     288        } else {
     289            $this->assertEquals( $wp_object_cache, $new_blank_cache_object );
     290        }
    285291    }
    286292
Note: See TracChangeset for help on using the changeset viewer.