Skip to content

Rackbeat/laravel-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Laravel SDK

Build Status Coverage Total Downloads Latest Stable Version License

Installation

You just require using composer and you're good to go!

composer require rackbeat/laravel-client

Usage

Coming soon...

Testing

The API class comes with a handful of mocking tools. You can mock a response or just assert that endpoints has been called.

Assert calls has been made

// Set up the API class to use mocking
\Rackbeat\API::mock();

// Has not been called yet 
\Rackbeat\API::assertNotCalled( 'get', '/lots' );

// Make a API call to GET /lots
\Rackbeat\API::lots()->index();

// Has now been called
\Rackbeat\API::assertCalled( 'get', '/lots' );

Mock the response

// Set up the API class to use mocking
\Rackbeat\API::mock();
\Rackbeat\API::mockResponse('GET', '/lots', 'no lots');

// Make a API call to GET /lots
\Rackbeat\API::lots()->index();

// Assert that the response was 'no lots'
\Rackbeat\API::assertResponded( 'get', '/lots', 'no lots' );

Contributors

...

Requirements

  • PHP >= 7.4
  • Laravel >= 6.0

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages