Commit f3dd74ff by Alexander Makarov

Removed custom Rule constructor

parent 5e278025
......@@ -24,20 +24,6 @@ abstract class Rule extends Object
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.
*
* @param array $params parameters passed to [[Manager::checkAccess()]].
......
......@@ -181,7 +181,7 @@ abstract class ManagerTestCase extends TestCase
public function testSaveRule()
{
$ruleName = 'isReallyReallyAuthor';
$rule = new AuthorRule($ruleName, ['reallyReally' => true]);
$rule = new AuthorRule(['name' => $ruleName, 'reallyReally' => true]);
$this->auth->saveRule($rule);
/** @var AuthorRule $rule */
......@@ -199,7 +199,7 @@ abstract class ManagerTestCase extends TestCase
public function testGetRules()
{
$rule = new AuthorRule('isReallyReallyAuthor', ['reallyReally' => true]);
$rule = new AuthorRule(['name' => 'isReallyReallyAuthor', 'reallyReally' => true]);
$this->auth->saveRule($rule);
$rules = $this->auth->getRules();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment