From 7a0da6f148f7ce8da58a0c94a1cfcda5f9601f2b Mon Sep 17 00:00:00 2001 From: WordPressFan Date: Mon, 1 Jul 2024 15:16:19 +0300 Subject: [PATCH] fix tests --- .../Media/AboveTheFold/WarmUp/Controller/sendToSass.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Unit/inc/Engine/Media/AboveTheFold/WarmUp/Controller/sendToSass.php b/tests/Unit/inc/Engine/Media/AboveTheFold/WarmUp/Controller/sendToSass.php index b3c79f5c78..5f4bbfdd02 100644 --- a/tests/Unit/inc/Engine/Media/AboveTheFold/WarmUp/Controller/sendToSass.php +++ b/tests/Unit/inc/Engine/Media/AboveTheFold/WarmUp/Controller/sendToSass.php @@ -36,13 +36,15 @@ protected function setUp(): void { * @dataProvider configTestData */ public function testShouldReturnExpected( $config, $expected ) { + $mobile_cache = 'mobile' === $config['device'] ? 1 : 0; + $this->options->shouldReceive('get') ->with( 'cache_mobile', 1 ) - ->andReturn( 1 ); + ->andReturn( $mobile_cache ); $this->options->shouldReceive('get') ->with( 'do_caching_mobile_files', 1 ) - ->andReturn( 1 ); + ->andReturn( $mobile_cache ); $this->api_client->shouldReceive('add_to_atf_queue') ->with('http://example.com') @@ -50,8 +52,6 @@ public function testShouldReturnExpected( $config, $expected ) { ->andReturn([$config['url'], []]); if('mobile' === $config['device']) { - - $this->api_client->shouldReceive('add_to_atf_queue') ->with( 'http://example.com', $config['device'] ) ->once()