Skip to content

Commit 522fa66

Browse files
committed
Fix tests
1 parent 063eaad commit 522fa66

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

tests/ad/prepare_ad_code_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function test_returns_empty_string_unchanged()
3030
self::assertSame('', $this->get_manager()->prepare_ad_code('', true));
3131
}
3232

33-
public function executable_script_type_data()
33+
public static function executable_script_type_data()
3434
{
3535
return [
3636
'normal script' => [
@@ -86,7 +86,7 @@ public function test_does_not_double_wrap_already_tagged_script()
8686
self::assertSame(1, substr_count($result, 'data-consent-category='));
8787
}
8888

89-
public function google_consent_aware_script_data()
89+
public static function google_consent_aware_script_data()
9090
{
9191
return [
9292
'adsense loader' => [

tests/event/setup_ads_consentmanager_test.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ public function test_setup_ads_defers_ad_markup_when_consentmanager_is_enabled()
2525

2626
$this->manager = $this->getMockBuilder('\phpbb\ads\ad\manager')
2727
->disableOriginalConstructor()
28-
->setMethods(array('load_memberships', 'get_ads'))
28+
->onlyMethods(array('load_memberships', 'get_ads'))
2929
->getMock();
3030
$this->location_manager = $this->getMockBuilder('\phpbb\ads\location\manager')
3131
->disableOriginalConstructor()
32-
->setMethods(array('get_all_location_ids'))
32+
->onlyMethods(array('get_all_location_ids'))
3333
->getMock();
3434

3535
$this->location_manager->expects(self::once())
@@ -87,11 +87,11 @@ public function test_setup_ads_adds_consent_category_to_text_plain_scripts()
8787

8888
$this->manager = $this->getMockBuilder('\phpbb\ads\ad\manager')
8989
->disableOriginalConstructor()
90-
->setMethods(array('load_memberships', 'get_ads'))
90+
->onlyMethods(array('load_memberships', 'get_ads'))
9191
->getMock();
9292
$this->location_manager = $this->getMockBuilder('\phpbb\ads\location\manager')
9393
->disableOriginalConstructor()
94-
->setMethods(array('get_all_location_ids'))
94+
->onlyMethods(array('get_all_location_ids'))
9595
->getMock();
9696

9797
$this->location_manager->expects(self::once())
@@ -146,11 +146,11 @@ public function test_setup_ads_does_not_defer_when_marketing_category_is_disable
146146

147147
$this->manager = $this->getMockBuilder('\phpbb\ads\ad\manager')
148148
->disableOriginalConstructor()
149-
->setMethods(array('load_memberships', 'get_ads'))
149+
->onlyMethods(array('load_memberships', 'get_ads'))
150150
->getMock();
151151
$this->location_manager = $this->getMockBuilder('\phpbb\ads\location\manager')
152152
->disableOriginalConstructor()
153-
->setMethods(array('get_all_location_ids'))
153+
->onlyMethods(array('get_all_location_ids'))
154154
->getMock();
155155

156156
$this->location_manager->expects(self::once())
@@ -201,11 +201,11 @@ public function test_setup_ads_does_not_defer_when_ad_consent_is_disabled()
201201

202202
$this->manager = $this->getMockBuilder('\phpbb\ads\ad\manager')
203203
->disableOriginalConstructor()
204-
->setMethods(array('load_memberships', 'get_ads'))
204+
->onlyMethods(array('load_memberships', 'get_ads'))
205205
->getMock();
206206
$this->location_manager = $this->getMockBuilder('\phpbb\ads\location\manager')
207207
->disableOriginalConstructor()
208-
->setMethods(array('get_all_location_ids'))
208+
->onlyMethods(array('get_all_location_ids'))
209209
->getMock();
210210

211211
$this->location_manager->expects(self::once())

0 commit comments

Comments
 (0)