Framework Update
This commit is contained in:
+26
-8
@@ -127,15 +127,21 @@ class BusFake implements QueueingDispatcher
|
||||
/**
|
||||
* Assert if a job was pushed a number of times.
|
||||
*
|
||||
* @param string $command
|
||||
* @param string|\Closure $command
|
||||
* @param int $times
|
||||
* @return void
|
||||
*/
|
||||
public function assertDispatchedTimes($command, $times = 1)
|
||||
{
|
||||
$count = $this->dispatched($command)->count() +
|
||||
$this->dispatchedAfterResponse($command)->count() +
|
||||
$this->dispatchedSync($command)->count();
|
||||
$callback = null;
|
||||
|
||||
if ($command instanceof Closure) {
|
||||
[$command, $callback] = [$this->firstClosureParameterType($command), $command];
|
||||
}
|
||||
|
||||
$count = $this->dispatched($command, $callback)->count() +
|
||||
$this->dispatchedAfterResponse($command, $callback)->count() +
|
||||
$this->dispatchedSync($command, $callback)->count();
|
||||
|
||||
PHPUnit::assertSame(
|
||||
$times, $count,
|
||||
@@ -200,13 +206,19 @@ class BusFake implements QueueingDispatcher
|
||||
/**
|
||||
* Assert if a job was pushed synchronously a number of times.
|
||||
*
|
||||
* @param string $command
|
||||
* @param string|\Closure $command
|
||||
* @param int $times
|
||||
* @return void
|
||||
*/
|
||||
public function assertDispatchedSyncTimes($command, $times = 1)
|
||||
{
|
||||
$count = $this->dispatchedSync($command)->count();
|
||||
$callback = null;
|
||||
|
||||
if ($command instanceof Closure) {
|
||||
[$command, $callback] = [$this->firstClosureParameterType($command), $command];
|
||||
}
|
||||
|
||||
$count = $this->dispatchedSync($command, $callback)->count();
|
||||
|
||||
PHPUnit::assertSame(
|
||||
$times, $count,
|
||||
@@ -259,13 +271,19 @@ class BusFake implements QueueingDispatcher
|
||||
/**
|
||||
* Assert if a job was pushed after the response was sent a number of times.
|
||||
*
|
||||
* @param string $command
|
||||
* @param string|\Closure $command
|
||||
* @param int $times
|
||||
* @return void
|
||||
*/
|
||||
public function assertDispatchedAfterResponseTimes($command, $times = 1)
|
||||
{
|
||||
$count = $this->dispatchedAfterResponse($command)->count();
|
||||
$callback = null;
|
||||
|
||||
if ($command instanceof Closure) {
|
||||
[$command, $callback] = [$this->firstClosureParameterType($command), $command];
|
||||
}
|
||||
|
||||
$count = $this->dispatchedAfterResponse($command, $callback)->count();
|
||||
|
||||
PHPUnit::assertSame(
|
||||
$times, $count,
|
||||
|
||||
Reference in New Issue
Block a user