Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transient functions #3551

Merged
merged 2 commits into from
Jul 24, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix expiration test
  • Loading branch information
felipeelia committed Jul 21, 2023
commit 1fbf8b727d14fd75a471c0cb655ab323017252c2
6 changes: 3 additions & 3 deletions tests/php/TestUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,18 +397,18 @@ public function testGetElasticsearchErrorReason() {
* @group utils
*/
public function test_set_transient() {
Utils\set_transient( 'foo', 'bar', 1 );

$filter_name = is_multisite() ?
'expiration_of_site_transient_foo' :
'expiration_of_transient_foo';

$check_expiration = function ( $expiration ) {
$this->assertSame( 10, $expiration );
$this->assertSame( 1, $expiration );
return $expiration;
};
add_filter( $filter_name, $check_expiration );

Utils\set_transient( 'foo', 'bar', 1 );

$this->assertSame( 1, did_filter( $filter_name ) );
}

Expand Down