/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/Integration/Foundation/Configuration/WithScheduleTest.php
37 строк
1 KB
Mior Muhammad Zaki
[13.x] Defer registering schedule registered using `ApplicationBuilder::withScheduling()` (#58160)
28 дек 2025, 21:04
Не верифицирован
28 дек 2025, 21:04
9dbeb87
Код
Авторство
О чём код?
<?php namespace Illuminate\Tests\Integration\Foundation\Configuration; use Illuminate\Console\Scheduling\ScheduleListCommand; use Illuminate\Foundation\Application; use Illuminate\Support\Carbon; use Orchestra\Testbench\TestCase; class WithScheduleTest extends TestCase { protected function setUp(): void { parent::setUp(); Carbon::setTestNow('2023-01-01'); ScheduleListCommand::resolveTerminalWidthUsing(fn () => 80); } protected function resolveApplication() { return Application::configure(static::applicationBasePath()) ->withSchedule(function ($schedule) { $schedule->command('schedule:clear-cache')->everyMinute(); }) ->withCommands([__DIR__.'/stubs/console.php']) ->create(); } public function testDisplaySchedule() { $this->artisan(ScheduleListCommand::class) ->assertSuccessful() ->expectsOutputToContain(' 0 * * * * php artisan test:inspire .............. Next Due: 1 hour from now') ->expectsOutputToContain(' * * * * * php artisan schedule:clear-cache .... Next Due: 1 minute from now'); } }