Skip to content
Permalink
Browse files

Test Users::roles()

  • Loading branch information...
bastianallgeier committed Jun 18, 2019
1 parent 086170b commit d8a265e05ed202abd212f8e37d939bf9f8262c1a
Showing with 19 additions and 0 deletions.
  1. +19 −0 tests/Cms/Users/UsersTest.php
@@ -54,4 +54,23 @@ public function testCustomMethods()
Users::$methods = [];
}
public function testRoles()
{
$app = new App([
'users' => [
['email' => 'a@getkirby.com', 'role' => 'admin'],
['email' => 'b@getkirby.com', 'role' => 'editor'],
['email' => 'c@getkirby.com', 'role' => 'editor'],
],
'roles' => [
['name' => 'admin'],
['name' => 'editor']
]
]);
$this->assertCount(1, $app->users()->role('admin'));
$this->assertCount(2, $app->users()->role('editor'));
}
}

0 comments on commit d8a265e

Please sign in to comment.
You can’t perform that action at this time.