PHP Класс Artesaos\Defender\Testing\EloquentPermissionRepositoryTest

Наследование: extends AbstractTestCase
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$providers array Array of service providers.

Открытые методы

Метод Описание
setUp ( )
testShouldAttachPermissionToRole ( ) Testing if permission is attached to role.
testShouldCreatePermission ( ) Testing the criation of permissions.
testUserShouldHasPermissionsTrait ( ) Asserting if the User model has traits.

Защищенные методы

Метод Описание
createAndAttachPermission ( string $permission, User | array $user, string $readableName = null ) : array Create and Attach a Permission to User.
createAndAttachPermissionToRole ( string $permission, Artesaos\Defender\Role $role, string $readableName = null ) : array Create and Attach a Permission to User.
createPermission ( string $name, string $readableName = null ) : Artesaos\Defender\Permission Create a permission and assert to see in database.
notSeePermissionAttachedToRoleInDatabase ( Artesaos\Defender\Permission $permission, Artesaos\Defender\Role $role ) Assert to not see in Database a Permission attached to Role.
notSeePermissionAttachedToUserInDatabase ( Artesaos\Defender\Permission $permission, User $user ) Assert to not see in Database a Permission attached to User.
seePermissionAttachedToRoleInDatabase ( Artesaos\Defender\Permission $permission, Artesaos\Defender\Role $role ) Assert to see in Database a Permission attached to Role.
seePermissionAttachedToUserInDatabase ( Artesaos\Defender\Permission $permission, User $user ) Assert to see in Database a Permission attached to User.

Описание методов

createAndAttachPermission() защищенный метод

Create and Attach a Permission to User.
protected createAndAttachPermission ( string $permission, User | array $user, string $readableName = null ) : array
$permission string
$user User | array User or array of where clausules.
$readableName string Permission readable name.
Результат array Array containing created $permission and $user.

createAndAttachPermissionToRole() защищенный метод

Create and Attach a Permission to User.
protected createAndAttachPermissionToRole ( string $permission, Artesaos\Defender\Role $role, string $readableName = null ) : array
$permission string
$role Artesaos\Defender\Role Role or array of where clausules.
$readableName string Permission readable name.
Результат array Array containing created $permission and $role.

createPermission() защищенный метод

Create a permission and assert to see in database.
protected createPermission ( string $name, string $readableName = null ) : Artesaos\Defender\Permission
$name string
$readableName string
Результат Artesaos\Defender\Permission

notSeePermissionAttachedToRoleInDatabase() защищенный метод

Assert to not see in Database a Permission attached to Role.
protected notSeePermissionAttachedToRoleInDatabase ( Artesaos\Defender\Permission $permission, Artesaos\Defender\Role $role )
$permission Artesaos\Defender\Permission
$role Artesaos\Defender\Role

notSeePermissionAttachedToUserInDatabase() защищенный метод

Assert to not see in Database a Permission attached to User.
protected notSeePermissionAttachedToUserInDatabase ( Artesaos\Defender\Permission $permission, User $user )
$permission Artesaos\Defender\Permission
$user User

seePermissionAttachedToRoleInDatabase() защищенный метод

Assert to see in Database a Permission attached to Role.
protected seePermissionAttachedToRoleInDatabase ( Artesaos\Defender\Permission $permission, Artesaos\Defender\Role $role )
$permission Artesaos\Defender\Permission
$role Artesaos\Defender\Role

seePermissionAttachedToUserInDatabase() защищенный метод

Assert to see in Database a Permission attached to User.
protected seePermissionAttachedToUserInDatabase ( Artesaos\Defender\Permission $permission, User $user )
$permission Artesaos\Defender\Permission
$user User

setUp() публичный метод

public setUp ( )

testShouldAttachPermissionToRole() публичный метод

Testing if permission is attached to role.

testShouldCreatePermission() публичный метод

Testing the criation of permissions.

testUserShouldHasPermissionsTrait() публичный метод

Asserting if the User model has traits.

Описание свойств

$providers защищенное свойство

Array of service providers.
protected array $providers
Результат array