imanghafoori / laravel-makesure
A Laravel package to help you write expressive tests
Installs: 2 472
Dependents: 3
Suggesters: 0
Security: 0
Stars: 21
Watchers: 3
Forks: 3
Open Issues: 2
Requires
- php: >=7.0.0
- laravel/framework: ~5.1|6.*|7.*|8.*|9.*|10.*|11.*
Requires (Dev)
- mockery/mockery: ~1.3
- orchestra/database: @dev
- orchestra/testbench: ~3.0
This package is auto-updated.
Last update: 2024-11-12 21:05:36 UTC
README
Easier tests for laravel
This package tries to give you a more readable syntax to write
Installation
composer require imanghafoori/laravel-makesure --dev
Usage
You can use it like this :
MakeSure::about($this)-> ->sendingGetRequest('some-url') ->isRespondedWith() ->statusCode(402); // Instead of writing this : $this ->get('some-url') ->assertStatus(402);
You should start of with the MakeSure
alias or the Imanghafoori\MakeSure\Facades\MakeSure
Facade class like this:
MakeSure::about($this)->...
Note that for technical reasons you should always pass $this into the about
method.
then you have access to all of these methods:
sendingPostRequest
sendingJsonPostRequest
sendingDeleteRequest
sendingJsonDeleteRequest
sendingPutRequest
sendingJsonPutRequest
sendingPatchRequest
sendingJsonPatchRequest
sendingGetRequest
sendingJsonGetRequest