File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,11 +20,23 @@ class google_analytics_consentmanager_test extends \phpbb_functional_test_case
2020
2121 protected static function setup_extensions ()
2222 {
23- return ['phpbb/consentmanager ' , 'phpbb/googleanalytics ' ];
23+ $ extensions = ['phpbb/googleanalytics ' ];
24+
25+ if (self ::is_consentmanager_available ())
26+ {
27+ array_unshift ($ extensions , 'phpbb/consentmanager ' );
28+ }
29+
30+ return $ extensions ;
2431 }
2532
2633 public function test_consentmanager_defers_google_analytics_scripts ()
2734 {
35+ if (!self ::is_consentmanager_available ())
36+ {
37+ self ::markTestSkipped ('Consent Manager extension is not available. ' );
38+ }
39+
2840 $ this ->login ();
2941 $ this ->admin_login ();
3042 $ this ->add_lang ('acp/board ' );
@@ -51,6 +63,11 @@ public function test_consentmanager_defers_google_analytics_scripts()
5163
5264 public function test_google_analytics_runs_normally_when_analytics_category_is_disabled ()
5365 {
66+ if (!self ::is_consentmanager_available ())
67+ {
68+ self ::markTestSkipped ('Consent Manager extension is not available. ' );
69+ }
70+
5471 $ this ->login ();
5572 $ this ->admin_login ();
5673 $ this ->add_lang ('acp/board ' );
@@ -82,4 +99,9 @@ public function test_google_analytics_runs_normally_when_analytics_category_is_d
8299 $ crawler ->filter ('head > script[type="text/plain"][data-consent-category="analytics"] ' )->count ()
83100 );
84101 }
102+
103+ protected static function is_consentmanager_available ()
104+ {
105+ return is_file (__DIR__ . '/../../../../phpbb/consentmanager/ext.php ' );
106+ }
85107}
You can’t perform that action at this time.
0 commit comments