hatchetaustralia / laravel-schedule-testing
A lightweight package for testing Laravel schedules.
v0.1.3
2023-03-10 08:44 UTC
Requires
- php: ^8.0
- nesbot/carbon: ^2.64
Requires (Dev)
- illuminate/console: ^9.0
- illuminate/contracts: ^9.0
- illuminate/support: ^9.0
- orchestra/testbench: ^7.18
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^8.0|^9.0
- squizlabs/php_codesniffer: ^3.5
README
About Laravel Schedule Testing
Laravel Schedule Testing was created and is maintained by the developers at Hatchet and is a lightweight package for testing your scheduled commands in Laravel.
Installation
Minimum requirement of PHP 8.0 and Laravel 9
Require Laravel Schedule Testing via Composer:
composer require hatchetaustralia/laravel-schedule-testing --dev
Usage
class HourlyReportCommandTest extends TestCase { // Add the `InteractsWithSchedule` trait to your class use InteractsWithSchedule; public function testCommandRunsOnTheHour() { // Then, get started with using the `assertSchedule` method. $this->assertSchedule('reports:send-report') ->isScheduledToRunAt(now()->startOfHour()); } }
Assertions
Check out our documentation for further information on what assertions are available.
Contributing
Thank you for considering to contribute to Laravel Schedule Testing. All the contribution guidelines are mentioned here.
You can have a look at the CHANGELOG for constant updates & detailed information about the changes.
License
Laravel Schedule Testing is an open-sourced software licensed under the Do Not Harm License.