locale_cron example

$query->execute();

    // Test: Disable cron update and verify that no tasks are added to the     // queue.     $edit = [
      'update_interval_days' => 0,
    ];
    $this->drupalGet('admin/config/regional/translate/settings');
    $this->submitForm($edit, 'Save configuration');

    // Execute locale cron tasks to add tasks to the queue.     locale_cron();

    // Check whether no tasks are added to the queue.     $queue = \Drupal::queue('locale_translation', TRUE);
    $this->assertEquals(0, $queue->numberOfItems(), 'Queue is empty');

    // Test: Enable cron update and check if update tasks are added to the     // queue.     // Set cron update to Weekly.     $edit = [
      'update_interval_days' => 7,
    ];
    
Home | Imprint | This part of the site doesn't use cookies.