Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
1a7b4c53
Commit
1a7b4c53
authored
Jun 12, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added testcase of @UncleCoder
https://github.com/UncleCoder/yii2/commit/e43c503c2d8408f46fb4ff09330db4e5a9f1cf01
issue #3817
parent
48d8bdff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
ManagerTestCase.php
tests/unit/framework/rbac/ManagerTestCase.php
+12
-0
PhpManagerTest.php
tests/unit/framework/rbac/PhpManagerTest.php
+2
-2
No files found.
tests/unit/framework/rbac/ManagerTestCase.php
View file @
1a7b4c53
...
@@ -45,6 +45,18 @@ abstract class ManagerTestCase extends TestCase
...
@@ -45,6 +45,18 @@ abstract class ManagerTestCase extends TestCase
// todo: check duplication of name
// todo: check duplication of name
}
}
public
function
testGetChildren
()
{
$user
=
$this
->
auth
->
createRole
(
'user'
);
$this
->
auth
->
add
(
$user
);
$this
->
assertCount
(
0
,
$this
->
auth
->
getChildren
(
$user
->
name
));
$changeName
=
$this
->
auth
->
createPermission
(
'changeName'
);
$this
->
auth
->
add
(
$changeName
);
$this
->
auth
->
addChild
(
$user
,
$changeName
);
$this
->
assertCount
(
1
,
$this
->
auth
->
getChildren
(
$user
->
name
));
}
/*
/*
public function testRemove()
public function testRemove()
{
{
...
...
tests/unit/framework/rbac/PhpManagerTest
Case
.php
→
tests/unit/framework/rbac/PhpManagerTest.php
View file @
1a7b4c53
...
@@ -9,7 +9,7 @@ use yii\rbac\PhpManager;
...
@@ -9,7 +9,7 @@ use yii\rbac\PhpManager;
* @group rbac
* @group rbac
* @property \yii\rbac\PhpManager $auth
* @property \yii\rbac\PhpManager $auth
*/
*/
class
PhpManagerTest
Case
extends
ManagerTestCase
class
PhpManagerTest
extends
ManagerTestCase
{
{
protected
function
setUp
()
protected
function
setUp
()
{
{
...
@@ -32,7 +32,7 @@ class PhpManagerTestCase extends ManagerTestCase
...
@@ -32,7 +32,7 @@ class PhpManagerTestCase extends ManagerTestCase
{
{
$this
->
prepareData
();
$this
->
prepareData
();
$this
->
auth
->
save
();
$this
->
auth
->
save
();
$this
->
auth
->
clear
All
();
$this
->
auth
->
remove
All
();
$this
->
auth
->
load
();
$this
->
auth
->
load
();
// TODO : Check if loaded and saved data are the same.
// TODO : Check if loaded and saved data are the same.
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment