Created
December 4, 2020 19:35
-
-
Save anubisthejackle/7388cca61d86c51b759eece64eb7540f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Facades\Http; | |
use Tests\TestCase; | |
class HttpSeriesTest extends TestCase | |
{ | |
public function testHttpRequestsInSequence() { | |
Http::fake(); | |
Http::get('http://google.com'); | |
Http::get('http://example.com'); | |
Http::get('http://yahoo.com'); | |
$recordedUrls = Http::recorded(fn() => true); | |
$urlCallingOrder = [ | |
'http://google.com', | |
'http://example.com', | |
'http://yahoo.com', | |
]; | |
while($compareUrl = array_shift($urlCallingOrder)){ | |
list($calledUrlRequest, $calledUrlResponse) = $recordedUrls->shift(); | |
$this->assertEquals($compareUrl, $calledUrlRequest->url()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment