function CronCommandTest::testCronRun
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Functional/Command/CronCommandTest.php \Drupal\Tests\system\Functional\Command\CronCommandTest::testCronRun()
Tests cron runs.
File
-
core/
modules/ system/ tests/ src/ Functional/ Command/ CronCommandTest.php, line 39
Class
- CronCommandTest
- Tests cron runs as a console command.
Namespace
Drupal\Tests\system\Functional\CommandCode
public function testCronRun() : void {
$command = new CronCommand($this->container
->get('cron'));
$tester = new CommandTester($command);
$code = $tester->execute([]);
$this->assertStringContainsString('Cron ran successfully.', $tester->getDisplay());
$this->assertEquals(Command::SUCCESS, $code);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.