Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix / 9130 Changes for Approval Into Main #9310

Merged
merged 3 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ public function __construct(
}

/**
* Checks for available events and save them in settings.
* Syncs detected events into settings.
*
* @since 1.135.0
*/
public function check_for_events() {
public function sync_detected_events() {
$report = $this->get_report();
$detected_events = array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ class Conversion_Reporting_Provider {
private Conversion_Reporting_Cron $cron;

/**
* Conversion_Reporting_Events_Check instance.
* Conversion_Reporting_Events_Sync instance.
*
* @var Conversion_Reporting_Events_Check
* @var Conversion_Reporting_Events_Sync
*/
private Conversion_Reporting_Events_Sync $events_check;
private Conversion_Reporting_Events_Sync $events_sync;

/**
* Constructor.
Expand All @@ -68,8 +68,8 @@ public function __construct(
$this->user_options = $user_options;
$this->analytics = $analytics;

$this->events_check = new Conversion_Reporting_Events_Sync( $settings, $this->analytics );
$this->cron = new Conversion_Reporting_Cron( fn() => $this->cron_callback() );
$this->events_sync = new Conversion_Reporting_Events_Sync( $settings, $this->analytics );
$this->cron = new Conversion_Reporting_Cron( fn() => $this->cron_callback() );
}

/**
Expand Down Expand Up @@ -101,7 +101,7 @@ protected function cron_callback() {
$owner_id = $this->analytics->get_owner_id();
$restore_user = $this->user_options->switch_user( $owner_id );

$this->events_check->check_for_events();
$this->events_sync->sync_detected_events();

$restore_user();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ public function set_up() {
/**
* @dataProvider report_dimensions
*/
public function test_check_for_events( $detected_events, $report_rows ) {
public function test_sync_detected_events( $detected_events, $report_rows ) {
$this->setup_fake_handler_and_analytics( $report_rows );

$event_check = $this->get_instance();
$event_check->check_for_events();
$event_check->sync_detected_events();

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