Skip to content

Commit 46674ff

Browse files
committed
🎨✅ in fact,i want use rbac-with-domains
1 parent 02c842e commit 46674ff

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/Commands/GroupAddTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace Lauthz\Tests\Commands;
4+
5+
use Illuminate\Foundation\Testing\DatabaseMigrations;
6+
use Illuminate\Support\Facades\Artisan;
7+
use Lauthz\Facades\Enforcer;
8+
use Lauthz\Tests\TestCase;
9+
10+
class GroupAddTest extends TestCase
11+
{
12+
use DatabaseMigrations;
13+
14+
public function testHandle()
15+
{
16+
$this->assertFalse(Enforcer::hasGroupingPolicy('eve', 'writer', 'domain'));
17+
18+
$exitCode = Artisan::call('group:add', ['policy' => 'eve, writer, domain']);
19+
$this->assertTrue(0 === $exitCode);
20+
$this->assertTrue(Enforcer::hasGroupingPolicy('eve', 'writer', 'domain'));
21+
22+
$exitCode = Artisan::call('group:add', ['policy' => 'eve, writer, domain']);
23+
$this->assertFalse(0 === $exitCode);
24+
}
25+
}

0 commit comments

Comments
 (0)