Download the PHP package centire/laravel-test-assertions without Composer
On this page you can find all versions of the php package centire/laravel-test-assertions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download centire/laravel-test-assertions
More information about centire/laravel-test-assertions
Files in centire/laravel-test-assertions
Package laravel-test-assertions
Short Description A set of helpful assertions when testing Laravel applications.
License MIT
Informations about the package laravel-test-assertions
Laravel Test Assertions
A set of helpful assertions when testing Laravel applications.
Requirements
Your application must be running the latest LTS version (5.5) or higher and using Laravel's testing harness.
Installation
You may install these assertions with Composer by running:
Afterwards, add the trait to your base TestCase
class:
Assertions
This package adds several assertions helpful when writing Http Tests.
Verifies the action for a given controller performs validation using the given form request.
Verifies that the corresponding action/controller, for a given route name performs the validation using the given form request.
Verifies the action for a given controller uses the given middleware or set of middleware.
Verifies the route for a given route name uses all the given middlewares or only the given set of middlewares.
Verifies the expected subset of validation rules for fields are within a set of validation rules. Rules may be passed as a delimited string or array.
Verifies the expected set of validation rules for fields exactly match a set of validation rules. Rules may be passed as a delimited string or array.
Verifies the rule or rules contains an instance of the given Rule class.
Matchers
Matches an argument is the same as $model
. When called without $model
, will match any argument of type Illuminate\Database\Eloquent\Model
.
Matches an argument equals $collection
. When called without $collection
, will match any argument of type Illuminate\Support\Collection
.
Matches an argument equals $collection
. When called without $collection
, will match any argument of type \Illuminate\Database\Eloquent\Collection
.
Creation Methods
This package also provides methods for quickly creating common objects used within Laravel application to use when testing.
Creates an instance of the given Form Request class with the given request data.