Removed custom Rule constructor

This commit is contained in:
Alexander Makarov
2014-04-04 22:43:11 +04:00
parent 5e278025b1
commit f3dd74ff97
2 changed files with 2 additions and 16 deletions

View File

@@ -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.
*

View File

@@ -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();