Skip to content

Commit

Permalink
Rename recentEvents setting to detectedEvents.
Browse files Browse the repository at this point in the history
  • Loading branch information
zutigrm committed Aug 28, 2024
1 parent 449f70c commit 614d0fe
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion includes/Modules/Analytics_4.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ function ( $audience ) {
'adSenseLinkedLastSyncedAt' => 0,
'adsLinked' => false,
'adsLinkedLastSyncedAt' => 0,
'recentEvents' => array(),
'detectedEvents' => array(),
'availableAudiencesLastSyncedAt' => 0,
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function check_for_events() {

// phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
if ( empty( $report->rowCount ) ) {
$this->settings->merge( array( 'recentEvents' => array() ) );
$this->settings->merge( array( 'detectedEvents' => array() ) );

return;
}
Expand All @@ -84,7 +84,7 @@ public function check_for_events() {
$detected_events[] = $row['dimensionValues'][0]['value'];
}

$this->settings->merge( array( 'recentEvents' => $detected_events ) );
$this->settings->merge( array( 'detectedEvents' => $detected_events ) );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion includes/Modules/Analytics_4/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected function get_default() {
'adsLinkedLastSyncedAt' => 0,
'availableAudiences' => null,
'availableAudiencesLastSyncedAt' => 0,
'recentEvents' => array(),
'detectedEvents' => array(),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function test_check_for_events( $detected_events, $report_rows ) {
$event_check = $this->get_instance();
$event_check->check_for_events();

$this->assertEquals( $detected_events, $this->settings->get()['recentEvents'] );
$this->assertEquals( $detected_events, $this->settings->get()['detectedEvents'] );
}

public function get_instance() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function test_get_default() {
'adsLinkedLastSyncedAt' => 0,
'availableAudiences' => null,
'availableAudiencesLastSyncedAt' => 0,
'recentEvents' => array(),
'detectedEvents' => array(),
),
get_option( Settings::OPTION )
);
Expand Down
10 changes: 5 additions & 5 deletions tests/phpunit/integration/Modules/Analytics_4Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ function ( Request $request ) use ( $property_id, $webdatastream_id, $measuremen
'adsLinkedLastSyncedAt' => 0,
'availableAudiences' => null,
'availableAudiencesLastSyncedAt' => 0,
'recentEvents' => array(),
'detectedEvents' => array(),
),
$options->get( Settings::OPTION )
);
Expand Down Expand Up @@ -582,7 +582,7 @@ function ( Request $request ) use ( $property_id, $webdatastream_id, $measuremen
'adsLinkedLastSyncedAt' => 0,
'availableAudiences' => null,
'availableAudiencesLastSyncedAt' => 0,
'recentEvents' => array(),
'detectedEvents' => array(),
),
$options->get( Settings::OPTION )
);
Expand Down Expand Up @@ -708,7 +708,7 @@ function ( Request $request ) use ( $property_id, $webdatastream_id, $measuremen
'adsLinkedLastSyncedAt' => 0,
'availableAudiences' => null,
'availableAudiencesLastSyncedAt' => 0,
'recentEvents' => array(),
'detectedEvents' => array(),
),
$options->get( Settings::OPTION )
);
Expand Down Expand Up @@ -835,7 +835,7 @@ function ( Request $request ) use ( $property_id, $webdatastream_id, $measuremen
'adsLinkedLastSyncedAt' => 0,
'availableAudiences' => null,
'availableAudiencesLastSyncedAt' => 0,
'recentEvents' => array(),
'detectedEvents' => array(),
),
$options->get( Settings::OPTION )
);
Expand Down Expand Up @@ -871,7 +871,7 @@ function ( Request $request ) use ( $property_id, $webdatastream_id, $measuremen
'adsLinkedLastSyncedAt' => 0,
'availableAudiences' => null,
'availableAudiencesLastSyncedAt' => 0,
'recentEvents' => array(),
'detectedEvents' => array(),
),
$options->get( Settings::OPTION )
);
Expand Down

0 comments on commit 614d0fe

Please sign in to comment.