Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Dec 7, 2020
1 parent af6ba0a commit d257ce2
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/Illuminate/Http/Client/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public function assertSentCount($count)
}

/**
* Assert that requests were sent in the order specified.
* Assert that the given request were sent in the given order.
*
* @param array $requestSequence
* @return void
Expand All @@ -273,16 +273,14 @@ public function assertSentInOrder($requestSequence)
$this->assertSentCount(count($requestSequence));

foreach ($requestSequence as $orderPosition => $url) {
$callback = is_callable($url) ? $url : function($request) use ($url) {
return $request->url() == $url;
};

$callback = $url;
if(!is_callable($url)){
$callback = function($request) use ($url) {
return $request->url() == $url;
};
}

PHPUnit::assertTrue( $callback( $this->recorded[ $orderPosition ][0], $this->recorded[ $orderPosition ][1] ) );

PHPUnit::assertTrue($callback(
$this->recorded[$orderPosition][0],
$this->recorded[$orderPosition][1]
));
}
}

Expand Down

0 comments on commit d257ce2

Please sign in to comment.