/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/Queue/PruneBatchesCommandTest.php
43 строки
1 KB
Jason McCreary
[13.x] Mockery cleanup (#61117)
10 авг 2026, 20:23
Не верифицирован
10 авг 2026, 20:23
2ee40ee
Код
Авторство
О чём код?
<?php namespace Illuminate\Tests\Queue; use Illuminate\Bus\BatchRepository; use Illuminate\Bus\DatabaseBatchRepository; use Illuminate\Foundation\Application; use Illuminate\Queue\Console\PruneBatchesCommand; use Mockery; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\NullOutput; class PruneBatchesCommandTest extends TestCase { public function testAllowPruningAllUnfinishedBatches() { $container = new Application; $repo = Mockery::spy(DatabaseBatchRepository::class); $container->instance(BatchRepository::class, $repo); $command = new PruneBatchesCommand; $command->setLaravel($container); $command->run(new ArrayInput(['--unfinished' => 0]), new NullOutput()); $repo->shouldHaveReceived('pruneUnfinished')->once(); } public function testAllowPruningAllCancelledBatches() { $container = new Application; $repo = Mockery::spy(DatabaseBatchRepository::class); $container->instance(BatchRepository::class, $repo); $command = new PruneBatchesCommand; $command->setLaravel($container); $command->run(new ArrayInput(['--cancelled' => 0]), new NullOutput()); $repo->shouldHaveReceived('pruneCancelled')->once(); } }