You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

26 lines
596 B

<?php
namespace Tests\iLaravel\Policies;
use App\Models\ILaravel;
use Tests\Bootstrap;
class GuestPolicyTest extends Bootstrap
{
function test_guest_policy_successful()
{
$this->modelWithPolicy('ilaravels', ['guest'])
->getJson(route('api.ilaravels.show', $this->one(ILaravel::class)))
->assertOk();
}
function test_guest_policy_fail()
{
$this->modelWithPolicy('ilaravels', ['guest'])
->loginAs()
->getJson(route('api.ilaravels.show', $this->one(ILaravel::class)))
->assertForbidden();
}
}