Skip to content

oceanapplications/HttpAssertInSequence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

composer require oceanapplications/httpassertinsequence

Add or replace the http alias in app/config with

'Http' => OceanApplications\HttpAssertInSequence\Http::class,

Use alias in all your files

use Http;

Usage

Works just like assertSent but allows you to specify which request to check

        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);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages