Changeset 53763 for trunk/tests/phpunit/tests/cache.php
- Timestamp:
- 07/22/2022 08:50:31 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/cache.php
r52706 r53763 416 416 $this->assertSame( $expected, $found ); 417 417 } 418 419 /** 420 * @ticket 4476 421 * @ticket 9773 422 * 423 * test wp_cache_flush_group 424 * 425 * @covers ::wp_cache_flush_group 426 */ 427 public function test_wp_cache_flush_group() { 428 $key = 'my-key'; 429 $val = 'my-val'; 430 431 wp_cache_set( $key, $val, 'group-test' ); 432 wp_cache_set( $key, $val, 'group-kept' ); 433 434 $this->assertSame( $val, wp_cache_get( $key, 'group-test' ), 'test_wp_cache_flush_group: group-test should contain my-val' ); 435 436 if ( wp_using_ext_object_cache() ) { 437 $this->setExpectedIncorrectUsage( 'wp_cache_flush_group' ); 438 } 439 440 $results = wp_cache_flush_group( 'group-test' ); 441 442 if ( wp_using_ext_object_cache() ) { 443 $this->assertFalse( $results ); 444 } else { 445 $this->assertTrue( $results ); 446 $this->assertFalse( wp_cache_get( $key, 'group-test' ), 'test_wp_cache_flush_group: group-test should return false' ); 447 $this->assertSame( $val, wp_cache_get( $key, 'group-kept' ), 'test_wp_cache_flush_group: group-kept should still contain my-val' ); 448 } 449 } 418 450 }
Note: See TracChangeset
for help on using the changeset viewer.