forked from apiato/apiato
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa0bd0e
commit 452a4c7
Showing
3 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
app/Containers/AppSection/Authorization/Tests/Unit/CreatePermissionTaskTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace App\Containers\AppSection\Authorization\Tests\Unit; | ||
|
||
use App\Containers\AppSection\Authorization\Tasks\CreatePermissionTask; | ||
use App\Containers\AppSection\Authorization\Tests\TestCase; | ||
|
||
/** | ||
* Class CreatePermissionTaskTest. | ||
* | ||
* @group authorization | ||
* @group unit | ||
*/ | ||
class CreatePermissionTaskTest extends TestCase | ||
{ | ||
public function testCreatePermission(): void | ||
{ | ||
$name = 'fuLl_coNtroL'; | ||
$description = 'Gives full control of everything!'; | ||
$display_name = 'Controller of All'; | ||
|
||
$permission = app(CreatePermissionTask::class)->run($name, $description, $display_name); | ||
|
||
$this->assertEquals(strtolower($name), $permission->name); | ||
$this->assertEquals($description, $permission->description); | ||
$this->assertEquals($display_name, $permission->display_name); | ||
$this->assertEquals('web', $permission->guard_name); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
app/Containers/AppSection/Authorization/Tests/Unit/CreateRoleTaskTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace App\Containers\AppSection\Authorization\Tests\Unit; | ||
|
||
use App\Containers\AppSection\Authorization\Tasks\CreateRoleTask; | ||
use App\Containers\AppSection\Authorization\Tests\TestCase; | ||
|
||
/** | ||
* Class CreateRoleTaskTest. | ||
* | ||
* @group authorization | ||
* @group unit | ||
*/ | ||
class CreateRoleTaskTest extends TestCase | ||
{ | ||
public function testCreateRole(): void | ||
{ | ||
$name = 'MEga_AdmIn'; | ||
$description = 'The One above all'; | ||
$display_name = 'Mega Admin the Almighty'; | ||
|
||
$role = app(CreateRoleTask::class)->run($name, $description, $display_name); | ||
|
||
$this->assertEquals(strtolower($name), $role->name); | ||
$this->assertEquals($description, $role->description); | ||
$this->assertEquals($display_name, $role->display_name); | ||
$this->assertEquals('web', $role->guard_name); | ||
} | ||
} |