pschocke/testmacros is a Laravel package for useful laravel macros that extend tests.
It currently has 0 GitHub stars and 26 downloads on Packagist.
Install it with composer require pschocke/testmacros.
Discover more Laravel packages by pschocke
or browse all Laravel packages to compare alternatives.
Last updated
This Package is inspired by Spaties Laravel Collections package and extends Laravels default Testing methods with a few useful macros.
Via Composer
$ composer require pschocke/testmacros --dev
The package will automatically register itself.
assertResourceAsserts that a response is a resource
$model = factory(App\Model::class)->create();
$this->json('GET', '/route/to/resource')->assertResource(new ModelResource($model));
asArrayReturns the response of a call
$responseArray = $this->json('GET', '/route/to/response')->asArray();
ResourceAsArrayReturns the data attribute of a API resource response
$responseArray = $this->json('GET', '/route/to/resource')->resourceAsArray();
Please see the changelog for more information on what has changed recently.
TODO
Please see contributing.md for details and a todolist.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
MIT. Please see the license file for more information.