1
0
mirror of https://github.com/flarum/core.git synced 2025-07-30 21:20:24 +02:00

Include task scheduler in core

This commit is contained in:
Alexander Skvortsov
2021-03-16 23:04:08 -04:00
committed by Alexander Skvortsov
parent d29495203b
commit 8dd57ffed2
7 changed files with 157 additions and 5 deletions

View File

@@ -43,6 +43,37 @@ class ConsoleTest extends ConsoleTestCase
$this->assertEquals('Custom Command.', $this->runCommand($input));
}
/**
* @test
*/
public function scheduled_command_doesnt_exist_by_default()
{
$input = [
'command' => 'schedule:list'
];
$this->assertStringNotContainsString('cache:clear', $this->runCommand($input));
}
/**
* @test
*/
public function scheduled_command_exists_when_added()
{
$this->extend(
(new Extend\Console())
->schedule('cache:clear', function ($event) {
$event->everyMinute();
})
);
$input = [
'command' => 'schedule:list'
];
$this->assertStringContainsString('cache:clear', $this->runCommand($input));
}
}
class CustomCommand extends AbstractCommand