🎨 in fact,i want use rbac-with-domains

This commit is contained in:
osi 2019-06-02 23:49:33 +08:00
parent 02c842e63b
commit 46674ff73f
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
<?php
namespace Lauthz\Tests\Commands;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Support\Facades\Artisan;
use Lauthz\Facades\Enforcer;
use Lauthz\Tests\TestCase;
class GroupAddTest extends TestCase
{
use DatabaseMigrations;
public function testHandle()
{
$this->assertFalse(Enforcer::hasGroupingPolicy('eve', 'writer', 'domain'));
$exitCode = Artisan::call('group:add', ['policy' => 'eve, writer, domain']);
$this->assertTrue(0 === $exitCode);
$this->assertTrue(Enforcer::hasGroupingPolicy('eve', 'writer', 'domain'));
$exitCode = Artisan::call('group:add', ['policy' => 'eve, writer, domain']);
$this->assertFalse(0 === $exitCode);
}
}