You are here

public function CronRunTest::testManualCron in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/System/CronRunTest.php \Drupal\system\Tests\System\CronRunTest::testManualCron()

Ensure that the manual cron run is working.

File

core/modules/system/src/Tests/System/CronRunTest.php, line 117
Contains \Drupal\system\Tests\System\CronRunTest.

Class

CronRunTest
Tests cron runs.

Namespace

Drupal\system\Tests\System

Code

public function testManualCron() {
  $admin_user = $this
    ->drupalCreateUser(array(
    'administer site configuration',
  ));
  $this
    ->drupalLogin($admin_user);
  $this
    ->drupalGet('admin/reports/status/run-cron');
  $this
    ->assertResponse(403);
  $this
    ->drupalGet('admin/reports/status');
  $this
    ->clickLink(t('run cron manually'));
  $this
    ->assertResponse(200);
  $this
    ->assertText(t('Cron ran successfully.'));
}