Skip to content

Commit

Permalink
Merge pull request #9310 from google/fix/9130-changes-for-approval-in…
Browse files Browse the repository at this point in the history
…to-main
  • Loading branch information
aaemnnosttv committed Sep 6, 2024
2 parents ebcb7b7 + 1c0199f commit bbfc158
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
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

0 comments on commit bbfc158

Please sign in to comment.