Download the PHP package anthonyedmonds/laravel-testing-traits without Composer
On this page you can find all versions of the php package anthonyedmonds/laravel-testing-traits. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download anthonyedmonds/laravel-testing-traits
More information about anthonyedmonds/laravel-testing-traits
Files in anthonyedmonds/laravel-testing-traits
Download anthonyedmonds/laravel-testing-traits
More information about anthonyedmonds/laravel-testing-traits
Files in anthonyedmonds/laravel-testing-traits
Vendor anthonyedmonds
Package laravel-testing-traits
Short Description Make testing easier with this collection of testing traits!
License MIT
Homepage https://github.com/AnthonyEdmonds/laravel-testing-traits
Package laravel-testing-traits
Short Description Make testing easier with this collection of testing traits!
License MIT
Homepage https://github.com/AnthonyEdmonds/laravel-testing-traits
Please rate this library. Is it a good library?
Informations about the package laravel-testing-traits
Laravel Testing Traits
Make testing easier with this collection of testing traits!
Installation
-
Add the library using Composer:
-
The service provider will be automatically registered. If required, you can manually register the service provider by adding it to your bootstrap/providers.php:
-
If you are not using the standard
App\Models\User
model, publish the config file using Artisan:Then update the config to point to your model:
Usage
- Add the desired traits to your
Tests\TestCase.php
class - Use the test methods in your tests:
Available traits
Trait | Purpose | Methods |
---|---|---|
AssertsActivities | Test whether a Spatie/ActivityLog has been recorded | assertActivity |
AssetsFlashMessages | Test whether a Laracasts/Flash message has been set | assertFlashed |
AssertsFormRequests | Test whether a FormRequest validates as expected | assertFormRequestPasses, assertFormRequestFails |
AssertsOrder | Test whether a Collection is in order | assertAscending, assertDescending |
AssertsPolicies | Test whether a Policy works as expected | assertPolicyAllows, assertPolicyDenies |
AssertsRelationships | Test whether a Model relationship loads as expected | assertBelongsTo, assertBelongsToMany, assertHasMany, assertHasOne |
AssertsResults | Test whether a Collection contains the expected values | assertResultsMatch, assertResultsContain, assertResultsDontContain, assertResultsCount |
AssertsValidationRules | Test whether a custom Rule works as expected | assertRulesPasses, assertRuleFails |
FakesRoutes | Fool Laravel into thinking you are on a specific route | fakeRoute |
GetsRawCsvs | Process a raw CSV into an array for parsing | processRawCsv |
GetsStreamedResponses | Intercept a StreamedResponse for testing files | getStreamedResponse |
SetsViewVariables | Set View variables for testing rendered blades, such as with Mojito | setRequestOld, setViewAttributes, setViewErrors, setViewSlot |
SignsInUsers | Sign a User in with relevant Spatie/LaravelPermission Roles and Permissions | signIn, signInAs, signInWithRole, signInWithPermission |
All versions of laravel-testing-traits with dependencies
PHP Build Version
Package Version
The package anthonyedmonds/laravel-testing-traits contains the following files
Loading the files please wait ....