Skip to content

Commit

Permalink
Add test for Issue Automattic#61
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Jenkins committed Jun 18, 2020
1 parent 9793b46 commit e87385f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test-object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,26 @@ public function test_add_non_persistent_groups_does_not_allow_duplicate_groups()
$this->assertCount( 1, array_keys( $this->object_cache->no_mc_groups, 'group-1' ) );
}

public function test_found_is_set_when_using_non_persistent_groups(): void {
/**
* wp> wp_cache_add_non_persistent_groups( [ 'example' ] );
* NULL
* wp> wp_cache_set( 'example', 'example', 'example' );
* bool(true)
* wp> wp_cache_get( 'example', 'example', false, $found );
* string(7) "example"
* wp> $found
* bool(false)
*/

$groups = [ 'example' ];
$this->object_cache->add_non_persistent_groups( $groups );
$this->object_cache->set( 'example', 'example', 'example' );
$this->object_cache->get( 'example', 'example', false, $found );

$this->asserteTrue( $found );
}

// Tests for increment.

public function test_incr_increments_a_numeric_value(): void {
Expand Down

0 comments on commit e87385f

Please sign in to comment.