You are here

public function MonitoringCronErrorPluginTest::setup in Monitoring 8

File

tests/src/Kernel/MonitoringCronErrorPluginTest.php, line 24

Class

MonitoringCronErrorPluginTest
Kernel test for ultimate cron errors sensor plugin.

Namespace

Drupal\Tests\monitoring\Kernel

Code

public function setup() {
  parent::setUp();

  // Install schema to create the required tables.
  $this
    ->installSchema('ultimate_cron', [
    'ultimate_cron_log',
    'ultimate_cron_lock',
  ]);

  // Create cron jobs to be run.
  \Drupal::service('ultimate_cron.discovery')
    ->discoverCronJobs();

  // Disable system_cron job, so it does not create an additional error.
  $job = CronJob::load('system_cron');
  $job
    ->disable();
  $job
    ->save();
}