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
f3dd74ff
Commit
f3dd74ff
authored
Apr 04, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed custom Rule constructor
parent
5e278025
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
16 deletions
+2
-16
Rule.php
framework/rbac/Rule.php
+0
-14
ManagerTestCase.php
tests/unit/framework/rbac/ManagerTestCase.php
+2
-2
No files found.
framework/rbac/Rule.php
View file @
f3dd74ff
...
@@ -24,20 +24,6 @@ abstract class Rule extends Object
...
@@ -24,20 +24,6 @@ abstract class Rule extends Object
public
$name
;
public
$name
;
/**
/**
* Constructor.
*
* @param array $name name of the rule
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$name
=
null
,
$config
=
[])
{
if
(
$name
!==
null
)
{
$this
->
name
=
$name
;
}
parent
::
__construct
(
$config
);
}
/**
* Executes the rule.
* Executes the rule.
*
*
* @param array $params parameters passed to [[Manager::checkAccess()]].
* @param array $params parameters passed to [[Manager::checkAccess()]].
...
...
tests/unit/framework/rbac/ManagerTestCase.php
View file @
f3dd74ff
...
@@ -181,7 +181,7 @@ abstract class ManagerTestCase extends TestCase
...
@@ -181,7 +181,7 @@ abstract class ManagerTestCase extends TestCase
public
function
testSaveRule
()
public
function
testSaveRule
()
{
{
$ruleName
=
'isReallyReallyAuthor'
;
$ruleName
=
'isReallyReallyAuthor'
;
$rule
=
new
AuthorRule
(
$ruleName
,
[
'reallyReally'
=>
true
]);
$rule
=
new
AuthorRule
(
[
'name'
=>
$ruleName
,
'reallyReally'
=>
true
]);
$this
->
auth
->
saveRule
(
$rule
);
$this
->
auth
->
saveRule
(
$rule
);
/** @var AuthorRule $rule */
/** @var AuthorRule $rule */
...
@@ -199,7 +199,7 @@ abstract class ManagerTestCase extends TestCase
...
@@ -199,7 +199,7 @@ abstract class ManagerTestCase extends TestCase
public
function
testGetRules
()
public
function
testGetRules
()
{
{
$rule
=
new
AuthorRule
(
'isReallyReallyAuthor'
,
[
'reallyReally'
=>
true
]);
$rule
=
new
AuthorRule
(
[
'name'
=>
'isReallyReallyAuthor'
,
'reallyReally'
=>
true
]);
$this
->
auth
->
saveRule
(
$rule
);
$this
->
auth
->
saveRule
(
$rule
);
$rules
=
$this
->
auth
->
getRules
();
$rules
=
$this
->
auth
->
getRules
();
...
...
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