mirror of
https://github.com/itflow-org/itflow
synced 2026-06-21 01:01:05 +00:00
Allow PHP-8.2 and up Compatibility instead of just PHP-8.4
This commit is contained in:
@@ -137,7 +137,6 @@ class BusFake implements Fake, QueueingDispatcher
|
||||
* Assert if a job was pushed exactly once.
|
||||
*
|
||||
* @param string|\Closure $command
|
||||
* @param int $times
|
||||
* @return void
|
||||
*/
|
||||
public function assertDispatchedOnce($command)
|
||||
@@ -488,7 +487,7 @@ class BusFake implements Fake, QueueingDispatcher
|
||||
/**
|
||||
* Create a new assertion about a chained batch.
|
||||
*
|
||||
* @param \Closure $callback
|
||||
* @param \Closure(\Illuminate\Bus\PendingBatch): bool $callback
|
||||
* @return \Illuminate\Support\Testing\Fakes\ChainedBatchTruthTest
|
||||
*/
|
||||
public function chainedBatch(Closure $callback)
|
||||
@@ -499,11 +498,13 @@ class BusFake implements Fake, QueueingDispatcher
|
||||
/**
|
||||
* Assert if a batch was dispatched based on a truth-test callback.
|
||||
*
|
||||
* @param callable $callback
|
||||
* @param array|callable(\Illuminate\Bus\PendingBatch): bool $callback
|
||||
* @return void
|
||||
*/
|
||||
public function assertBatched(callable $callback)
|
||||
public function assertBatched(callable|array $callback)
|
||||
{
|
||||
$callback = is_array($callback) ? fn (PendingBatchFake $batch) => $batch->hasJobs($callback) : $callback;
|
||||
|
||||
PHPUnit::assertTrue(
|
||||
$this->batched($callback)->count() > 0,
|
||||
'The expected batch was not dispatched.'
|
||||
@@ -606,8 +607,8 @@ class BusFake implements Fake, QueueingDispatcher
|
||||
/**
|
||||
* Get all of the pending batches matching a truth-test callback.
|
||||
*
|
||||
* @param callable $callback
|
||||
* @return \Illuminate\Support\Collection
|
||||
* @param callable(\Illuminate\Bus\PendingBatch): bool $callback
|
||||
* @return \Illuminate\Support\Collection<int, \Illuminate\Bus\PendingBatch>
|
||||
*/
|
||||
public function batched(callable $callback)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user