From 0dbb293b66c211773049dd1f907f05db46334422 Mon Sep 17 00:00:00 2001 From: WordPressFan Date: Wed, 15 Nov 2023 11:07:10 +0200 Subject: [PATCH] fixing tests --- .../inc/ThirdParty/Hostings/Kinsta/cleanKinstaCache.php | 2 +- .../Integration/inc/ThirdParty/Hostings/SpinUpWP/purgeSite.php | 2 +- .../inc/ThirdParty/Hostings/WPEngine/cleanWPEngine.php | 2 +- .../inc/ThirdParty/Hostings/WordPressCom/purgeWPCache.php | 2 +- tests/Unit/inc/functions/rocketCleanDomain.php | 3 +++ 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/Integration/inc/ThirdParty/Hostings/Kinsta/cleanKinstaCache.php b/tests/Integration/inc/ThirdParty/Hostings/Kinsta/cleanKinstaCache.php index c138716a52..328e407e68 100644 --- a/tests/Integration/inc/ThirdParty/Hostings/Kinsta/cleanKinstaCache.php +++ b/tests/Integration/inc/ThirdParty/Hostings/Kinsta/cleanKinstaCache.php @@ -45,6 +45,6 @@ public function testShouldReturnAsExpected($config, $expected) { } else { $this->cache_purge->shouldReceive('purge_complete_caches')->never(); } - do_action('after_rocket_clean_domain'); + do_action('rocket_after_clean_domain'); } } diff --git a/tests/Integration/inc/ThirdParty/Hostings/SpinUpWP/purgeSite.php b/tests/Integration/inc/ThirdParty/Hostings/SpinUpWP/purgeSite.php index ae7b02e5c5..94218c9913 100644 --- a/tests/Integration/inc/ThirdParty/Hostings/SpinUpWP/purgeSite.php +++ b/tests/Integration/inc/ThirdParty/Hostings/SpinUpWP/purgeSite.php @@ -15,7 +15,7 @@ class Test_PurgeSite extends TestCase { public function testShouldCallSpinUpPurgeSite( ) { Functions\expect( 'spinupwp_purge_site' )->once(); - do_action( 'after_rocket_clean_domain' ); + do_action( 'rocket_after_clean_domain' ); } } diff --git a/tests/Integration/inc/ThirdParty/Hostings/WPEngine/cleanWPEngine.php b/tests/Integration/inc/ThirdParty/Hostings/WPEngine/cleanWPEngine.php index 56663c41a0..4371031151 100644 --- a/tests/Integration/inc/ThirdParty/Hostings/WPEngine/cleanWPEngine.php +++ b/tests/Integration/inc/ThirdParty/Hostings/WPEngine/cleanWPEngine.php @@ -26,7 +26,7 @@ public function set_up() { } public function testShouldCleanWPEngine() { - do_action( 'after_rocket_clean_domain' ); + do_action( 'rocket_after_clean_domain' ); $this->assertEquals( 1, WpeCommon::getNumberTimesPurgeMemcachedCalled() ); $this->assertEquals( 1, WpeCommon::getNumberTimesVarnishCacheCalled() ); diff --git a/tests/Integration/inc/ThirdParty/Hostings/WordPressCom/purgeWPCache.php b/tests/Integration/inc/ThirdParty/Hostings/WordPressCom/purgeWPCache.php index 32f7c51382..803d63fbbd 100644 --- a/tests/Integration/inc/ThirdParty/Hostings/WordPressCom/purgeWPCache.php +++ b/tests/Integration/inc/ThirdParty/Hostings/WordPressCom/purgeWPCache.php @@ -14,7 +14,7 @@ class Test_PurgeWpCache extends TestCase { public function testShouldPurgeWpCache( ) { wp_cache_set( 'homepage_cache', 'Homepage content' ); - do_action( 'after_rocket_clean_domain' ); + do_action( 'rocket_after_clean_domain' ); $this->assertFalse( wp_cache_get( 'homepage_cache' ) ); } diff --git a/tests/Unit/inc/functions/rocketCleanDomain.php b/tests/Unit/inc/functions/rocketCleanDomain.php index 478e4856c7..b1ba9cdfd3 100644 --- a/tests/Unit/inc/functions/rocketCleanDomain.php +++ b/tests/Unit/inc/functions/rocketCleanDomain.php @@ -105,6 +105,9 @@ public function testShouldCleanSingleDomain( $i18n, $expected, $config ) { Actions\expectDone( 'after_rocket_clean_domain' ) ->once() ->with( $config['root'], $lang, $url ); + Actions\expectDone( 'rocket_after_clean_domain' ) + ->once() + ->with( $lang, $expected['rocket_clean_domain_urls'] ); // Run it. rocket_clean_domain( $lang );