Wallogit.com
2017 © Pedro Peláez
You can check authorization with the ChecksAuthorization Trait, (*1)
use ChecksAuthorization;
...
$this->assertRequestDenies(new Request($get, $post));
$this->assertRequestGrants(new Request($get, $post));
You can fake a currently authenticated usser and set its Rights:, (*2)
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), (*3)