trait CronRunTrait in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php \Drupal\Tests\Traits\Core\CronRunTrait
- 9 core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php \Drupal\Tests\Traits\Core\CronRunTrait
Adds ability to run cron from tests.
Hierarchy
- trait \Drupal\Tests\Traits\Core\CronRunTrait
14 files declare their use of CronRunTrait
- BrowserTestBaseTest.php in core/tests/ Drupal/ FunctionalTests/ BrowserTestBaseTest.php 
- CronRunTest.php in core/modules/ system/ tests/ src/ Functional/ System/ CronRunTest.php 
- HelpTopicSearchTest.php in core/modules/ help_topics/ tests/ src/ Functional/ HelpTopicSearchTest.php 
- LocaleUpdateCronTest.php in core/modules/ locale/ tests/ src/ Functional/ LocaleUpdateCronTest.php 
- ReEnableModuleFieldTest.php in core/modules/ field/ tests/ src/ Functional/ ReEnableModuleFieldTest.php 
File
- core/tests/ Drupal/ Tests/ Traits/ Core/ CronRunTrait.php, line 8 
Namespace
Drupal\Tests\Traits\CoreView source
trait CronRunTrait {
  /**
   * Runs cron on the test site.
   */
  protected function cronRun() {
    $this
      ->drupalGet('cron/' . \Drupal::state()
      ->get('system.cron_key'));
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| CronRunTrait:: | protected | function | Runs cron on the test site. | 
