PHP code example of oceanapplications / httpassertinsequence
1. Go to this page and download the library: Download oceanapplications/httpassertinsequence library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
oceanapplications / httpassertinsequence example snippets
Http::fake([
'*' => Http::sequence()
->push(['data' => [ [] ] ], 200) // get customer, none found
->push(['data' => ['id' => 1] ], 200) // create customer
]);
$response = $this->post('createOrUpdate', ['email' => '[email protected]']);
Http::assertSentInSequence(function(Request $request) {
return $request['email'] == '[email protected]';
}, 1);