Loading core/modules/system/tests/src/Functional/System/CronRunTest.php +8 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ use Drupal\Tests\BrowserTestBase; use Drupal\Tests\Traits\Core\CronRunTrait; use Drupal\Tests\WaitTerminateTestTrait; /** * Tests cron runs. Loading @@ -13,6 +14,7 @@ class CronRunTest extends BrowserTestBase { use CronRunTrait; use WaitTerminateTestTrait; /** * Modules to enable. Loading Loading @@ -56,7 +58,12 @@ public function testCronRun() { * need the exact time when cron is triggered. */ public function testAutomatedCron() { // Test with a logged in user; anonymous users likely don't cause Drupal to // To prevent race conditions between the admin_user login triggering cron // and updating its state, and this test doing the same thing, we use // \Drupal\Tests\WaitTerminateTestTrait::setWaitForTerminate. $this->setWaitForTerminate(); // Test with a logged-in user; anonymous users likely don't cause Drupal to // fully bootstrap, because of the internal page cache or an external // reverse proxy. Reuse this user for disabling cron later in the test. $admin_user = $this->drupalCreateUser(['administer site configuration']); Loading Loading
core/modules/system/tests/src/Functional/System/CronRunTest.php +8 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ use Drupal\Tests\BrowserTestBase; use Drupal\Tests\Traits\Core\CronRunTrait; use Drupal\Tests\WaitTerminateTestTrait; /** * Tests cron runs. Loading @@ -13,6 +14,7 @@ class CronRunTest extends BrowserTestBase { use CronRunTrait; use WaitTerminateTestTrait; /** * Modules to enable. Loading Loading @@ -56,7 +58,12 @@ public function testCronRun() { * need the exact time when cron is triggered. */ public function testAutomatedCron() { // Test with a logged in user; anonymous users likely don't cause Drupal to // To prevent race conditions between the admin_user login triggering cron // and updating its state, and this test doing the same thing, we use // \Drupal\Tests\WaitTerminateTestTrait::setWaitForTerminate. $this->setWaitForTerminate(); // Test with a logged-in user; anonymous users likely don't cause Drupal to // fully bootstrap, because of the internal page cache or an external // reverse proxy. Reuse this user for disabling cron later in the test. $admin_user = $this->drupalCreateUser(['administer site configuration']); Loading