Changeset 52010 for trunk/tests/phpunit/tests/cache.php
- Timestamp:
- 11/04/2021 03:22:47 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/cache.php (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/cache.php
r51568 r52010 7 7 public $cache = null; 8 8 9 function set_up() {9 public function set_up() { 10 10 parent::set_up(); 11 11 // Create two cache objects with a shared cache directory. … … 14 14 } 15 15 16 function tear_down() {16 public function tear_down() { 17 17 $this->flush_cache(); 18 18 parent::tear_down(); 19 19 } 20 20 21 function &init_cache() {21 private function &init_cache() { 22 22 global $wp_object_cache; 23 23 $cache_class = get_class( $wp_object_cache ); … … 27 27 } 28 28 29 function test_miss() {29 public function test_miss() { 30 30 $this->assertFalse( $this->cache->get( 'test_miss' ) ); 31 31 } 32 32 33 function test_add_get() {33 public function test_add_get() { 34 34 $key = __FUNCTION__; 35 35 $val = 'val'; … … 39 39 } 40 40 41 function test_add_get_0() {41 public function test_add_get_0() { 42 42 $key = __FUNCTION__; 43 43 $val = 0; … … 51 51 * @ticket 20004 52 52 */ 53 function test_add_get_null() {53 public function test_add_get_null() { 54 54 $key = __FUNCTION__; 55 55 $val = null; … … 63 63 * @ticket 20004 64 64 */ 65 function test_add_get_false() {65 public function test_add_get_false() { 66 66 $key = __FUNCTION__; 67 67 $val = false; … … 72 72 } 73 73 74 function test_add() {74 public function test_add() { 75 75 $key = __FUNCTION__; 76 76 $val1 = 'val1'; … … 85 85 } 86 86 87 function test_replace() {87 public function test_replace() { 88 88 $key = __FUNCTION__; 89 89 $val = 'val1'; … … 99 99 } 100 100 101 function test_set() {101 public function test_set() { 102 102 $key = __FUNCTION__; 103 103 $val1 = 'val1'; … … 112 112 } 113 113 114 function test_flush() {114 public function test_flush() { 115 115 global $_wp_using_ext_object_cache; 116 116 … … 131 131 132 132 // Make sure objects are cloned going to and from the cache. 133 function test_object_refs() {133 public function test_object_refs() { 134 134 $key = __FUNCTION__ . '_1'; 135 135 $object_a = new stdClass; … … 153 153 } 154 154 155 function test_incr() {155 public function test_incr() { 156 156 $key = __FUNCTION__; 157 157 … … 166 166 } 167 167 168 function test_wp_cache_incr() {168 public function test_wp_cache_incr() { 169 169 $key = __FUNCTION__; 170 170 … … 179 179 } 180 180 181 function test_decr() {181 public function test_decr() { 182 182 $key = __FUNCTION__; 183 183 … … 199 199 * @ticket 21327 200 200 */ 201 function test_wp_cache_decr() {201 public function test_wp_cache_decr() { 202 202 $key = __FUNCTION__; 203 203 … … 216 216 } 217 217 218 function test_delete() {218 public function test_delete() { 219 219 $key = __FUNCTION__; 220 220 $val = 'val'; … … 231 231 } 232 232 233 function test_wp_cache_delete() {233 public function test_wp_cache_delete() { 234 234 $key = __FUNCTION__; 235 235 $val = 'val'; … … 250 250 } 251 251 252 function test_switch_to_blog() {252 public function test_switch_to_blog() { 253 253 if ( ! method_exists( $this->cache, 'switch_to_blog' ) ) { 254 254 $this->markTestSkipped( 'This test requires a switch_to_blog() method on the cache object.' ); … … 296 296 } 297 297 298 function test_wp_cache_init() {298 public function test_wp_cache_init() { 299 299 $new_blank_cache_object = new WP_Object_Cache(); 300 300 wp_cache_init(); … … 310 310 } 311 311 312 function test_wp_cache_replace() {312 public function test_wp_cache_replace() { 313 313 $key = 'my-key'; 314 314 $val1 = 'first-val';
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)