function BrowserTestBaseTest::testCronRun

Same name and namespace in other branches
  1. 9 core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php \Drupal\FunctionalTests\BrowserTestBaseTest::testCronRun()
  2. 8.9.x core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php \Drupal\FunctionalTests\BrowserTestBaseTest::testCronRun()
  3. 10 core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php \Drupal\FunctionalTests\BrowserTestBaseTest::testCronRun()

Tests the ::cronRun() method.

File

core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php, line 467

Class

BrowserTestBaseTest
Tests BrowserTestBase functionality.

Namespace

Drupal\FunctionalTests

Code

public function testCronRun() : void {
    $last_cron_time = \Drupal::state()->get('system.cron_last');
    $this->cronRun();
    $this->assertSession()
        ->statusCodeEquals(204);
    $next_cron_time = \Drupal::state()->get('system.cron_last');
    $this->assertGreaterThan($last_cron_time, $next_cron_time);
}

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