diff --git a/tests/phpunit/tests/functions/wpCacheSetLastChanged.php b/tests/phpunit/tests/functions/wpCacheSetLastChanged.php new file mode 100644 index 0000000000000..9394801c9600f --- /dev/null +++ b/tests/phpunit/tests/functions/wpCacheSetLastChanged.php @@ -0,0 +1,35 @@ +assertSame( wp_cache_set_last_changed( $group ), wp_cache_get( 'last_changed', $group ) ); + } + + /** + * Check the action is called. + * + * @ticket 59737 + */ + public function test_wp_cache_set_last_changed_action_is_called() { + $a1 = new MockAction(); + add_action( 'wp_cache_set_last_changed', array( $a1, 'action' ) ); + + wp_cache_set_last_changed( 'group_name' ); + + $this->assertSame( 1, $a1->get_call_count() ); + } +}