File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
tests/WP/Dashboard/Infrastructure/Analytics_4 Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3
+ namespace Yoast \WP \SEO \Tests \WP \Dashboard \Infrastructure \Analytics_4 ;
4
+
5
+ /**
6
+ * Test class for the is_connected() method, when Site Kit is not active.
7
+ *
8
+ * @group analytics_4_adapter
9
+ *
10
+ * @requires PHP >= 7.4
11
+ *
12
+ * @covers Yoast\WP\SEO\Dashboard\Infrastructure\Analytics_4\Site_Kit_Analytics_4_Adapter::is_connected
13
+ *
14
+ * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded
15
+ */
16
+ final class Analytics_4_Adapter_Is_Not_Connected_No_SiteKit_Test extends Abstract_Analytics_4_Adapter_Test {
17
+
18
+ /**
19
+ * Let's not activate the Site Kit plugin for this test.
20
+ *
21
+ * @var string
22
+ */
23
+ public $ prereq_plugin_basename = '' ;
24
+
25
+ /**
26
+ * Tests is_connected() returns false when Site Kit is not active, even if all the right values are in the DB.
27
+ *
28
+ * @return void
29
+ */
30
+ public function test_is_not_connected () {
31
+ $ analytics_4_settings = [
32
+ 'accountID ' => '123456789 ' ,
33
+ 'propertyID ' => '12345 ' ,
34
+ 'webDataStreamID ' => '1234 ' ,
35
+ 'measurementID ' => 'G-123456789 ' ,
36
+ ];
37
+ \update_option ( 'googlesitekit_analytics-4_settings ' , $ analytics_4_settings );
38
+
39
+ $ is_connected = $ this ->instance ->is_connected ();
40
+
41
+ $ this ->assertFalse ( $ is_connected );
42
+ }
43
+ }
You can’t perform that action at this time.
0 commit comments