diff --git a/tests/Unit/Integrations/Front_End_Integration_Test.php b/tests/Unit/Integrations/Front_End_Integration_Test.php index c05d1c910d5..78485815561 100644 --- a/tests/Unit/Integrations/Front_End_Integration_Test.php +++ b/tests/Unit/Integrations/Front_End_Integration_Test.php @@ -8,7 +8,6 @@ use WPSEO_Replace_Vars; use Yoast\WP\SEO\Conditionals\Front_End_Conditional; use Yoast\WP\SEO\Helpers\Options_Helper; -use Yoast\WP\SEO\Helpers\Request_Helper; use Yoast\WP\SEO\Integrations\Front_End_Integration; use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer; use Yoast\WP\SEO\Presentations\Indexable_Presentation; @@ -48,13 +47,6 @@ final class Front_End_Integration_Test extends TestCase { */ private $options; - /** - * Represents the request helper. - * - * @var Mockery\MockInterface|Request_Helper - */ - private $request; - /** * Represents the meta tags context memoizer. * @@ -94,7 +86,6 @@ protected function set_up() { $this->context_memoizer = Mockery::mock( Meta_Tags_Context_Memoizer::class ); $this->container = Mockery::mock( ContainerInterface::class ); $this->options = Mockery::mock( Options_Helper::class ); - $this->request = Mockery::mock( Request_Helper::class ); $this->instance = Mockery::mock( Front_End_Integration::class, @@ -102,7 +93,6 @@ protected function set_up() { $this->context_memoizer, $this->container, $this->options, - $this->request, Mockery::mock( Helpers_Surface::class ), Mockery::mock( WPSEO_Replace_Vars::class ), ] @@ -219,8 +209,7 @@ public function test_get_presenters_for_singular_page() { ->once() ->andReturn( $this->context ); - $this->request - ->expects( 'is_rest_request' ) + Monkey\Functions\expect( 'wp_is_serving_rest_request' ) ->once() ->andReturnFalse(); @@ -287,8 +276,7 @@ public function test_get_presenters_for_static_home_page() { ->once() ->andReturn( $this->context ); - $this->request - ->expects( 'is_rest_request' ) + Monkey\Functions\expect( 'wp_is_serving_rest_request' ) ->once() ->andReturnFalse(); @@ -360,8 +348,7 @@ public function test_get_presenters_for_error_page() { ->once() ->andReturn( $this->context ); - $this->request - ->expects( 'is_rest_request' ) + Monkey\Functions\expect( 'wp_is_serving_rest_request' ) ->once() ->andReturnFalse(); @@ -419,8 +406,7 @@ public function test_get_presenters_for_non_singular_page() { ->once() ->andReturn( $this->context ); - $this->request - ->expects( 'is_rest_request' ) + Monkey\Functions\expect( 'wp_is_serving_rest_request' ) ->once() ->andReturnFalse(); @@ -486,8 +472,7 @@ public function test_get_presenters_for_theme_without_title_tag_and_force_rewrit ->once() ->andReturn( $this->context ); - $this->request - ->expects( 'is_rest_request' ) + Monkey\Functions\expect( 'wp_is_serving_rest_request' ) ->once() ->andReturnFalse(); @@ -533,8 +518,7 @@ public function test_get_presenters_for_theme_on_rest_request() { ->once() ->andReturn( $this->context ); - $this->request - ->expects( 'is_rest_request' ) + Monkey\Functions\expect( 'wp_is_serving_rest_request' ) ->once() ->andReturnTrue(); @@ -588,8 +572,7 @@ public function test_get_presenters_for_theme_without_title_tag_and_force_rewrit ->once() ->andReturn( $this->context ); - $this->request - ->expects( 'is_rest_request' ) + Monkey\Functions\expect( 'wp_is_serving_rest_request' ) ->once() ->andReturnFalse(); @@ -662,8 +645,7 @@ public function test_filter_robots_presenter_and_wp_robots_to_wp_head_filter() { \add_action( 'wp_head', 'wp_robots' ); - $this->request - ->expects( 'is_rest_request' ) + Monkey\Functions\expect( 'wp_is_serving_rest_request' ) ->once() ->andReturnFalse(); @@ -694,8 +676,7 @@ public function test_rest_request_should_output_robots_presenter() { \add_action( 'wp_head', 'wp_robots' ); - $this->request - ->expects( 'is_rest_request' ) + Monkey\Functions\expect( 'wp_is_serving_rest_request' ) ->once() ->andReturnTrue(); diff --git a/tests/WP/Frontend/Front_End_Integration_Test.php b/tests/WP/Frontend/Front_End_Integration_Test.php index 169fa21caeb..011e8672593 100644 --- a/tests/WP/Frontend/Front_End_Integration_Test.php +++ b/tests/WP/Frontend/Front_End_Integration_Test.php @@ -5,7 +5,6 @@ use Mockery; use WPSEO_Replace_Vars; use Yoast\WP\SEO\Helpers\Options_Helper; -use Yoast\WP\SEO\Helpers\Request_Helper; use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer; use Yoast\WP\SEO\Presentations\Indexable_Presentation; use Yoast\WP\SEO\Surfaces\Helpers_Surface; @@ -41,13 +40,6 @@ final class Front_End_Integration_Test extends TestCase { */ protected $options; - /** - * Represents the request helper. - * - * @var Request_Helper - */ - protected $request; - /** * The helpers surface. * @@ -79,7 +71,6 @@ public function set_up(): void { $this->context_memoizer = Mockery::mock( Meta_Tags_Context_Memoizer::class ); $this->container = Mockery::mock( ContainerInterface::class ); $this->options = Mockery::mock( Options_Helper::class ); - $this->request = Mockery::mock( Request_Helper::class ); $this->helpers = Mockery::mock( Helpers_Surface::class ); $this->replace_vars = Mockery::mock( WPSEO_Replace_Vars::class ); @@ -87,7 +78,6 @@ public function set_up(): void { $this->context_memoizer, $this->container, $this->options, - $this->request, $this->helpers, $this->replace_vars );