mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-11 09:53:19 +01:00
Removed custom Rule constructor
This commit is contained in:
@@ -23,20 +23,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.
|
||||
*
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user