zoomyboy/tests

There is no license information available for the latest version (0.1.0) of this package.

0.1.0 2019-04-03 21:42 UTC

This package is auto-updated.

Last update: 2024-12-14 19:24:55 UTC


README

Checking Authorization

You can check authorization with the ChecksAuthorization Trait

    use ChecksAuthorization;

    ...

    $this->assertRequestDenies(new Request($get, $post));
    $this->assertRequestGrants(new Request($get, $post));

User mocking

You can fake a currently authenticated usser and set its Rights:

public $fakeUserModel = \App\User::class;

...

$this->mockUser(array $rights);

$rights is an array with all the right keys of this user. You should set the fakeUserModel on the test class to resolve the user (which is \App\User by default)