function CronRunTrait::cronRun

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php \Drupal\Tests\Traits\Core\CronRunTrait::cronRun()
  2. 10 core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php \Drupal\Tests\Traits\Core\CronRunTrait::cronRun()
  3. 11.x core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php \Drupal\Tests\Traits\Core\CronRunTrait::cronRun()

Runs cron on the test site.

20 calls to CronRunTrait::cronRun()
AggregatorCronTest::testCron in core/modules/aggregator/tests/src/Functional/AggregatorCronTest.php
Adds feeds and updates them via cron process.
BrowserTestBaseTest::testCronRun in core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
Tests the ::cronRun() method.
CronRunTest::testCronExceptions in core/modules/system/tests/src/Functional/System/CronRunTest.php
Make sure exceptions thrown on hook_cron() don't affect other modules.
FeedLanguageTest::testFeedLanguage in core/modules/aggregator/tests/src/Functional/FeedLanguageTest.php
Tests creation of feeds with a language.
FieldUpdateTest::testFieldUpdate8500 in core/modules/field/tests/src/Functional/Update/FieldUpdateTest.php
Tests field_update_8500().

... See full list

File

core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php, line 13

Class

CronRunTrait
Adds ability to run cron from tests.

Namespace

Drupal\Tests\Traits\Core

Code

protected function cronRun() {
    $this->drupalGet('cron/' . \Drupal::state()->get('system.cron_key'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.