Commit 3b7ac70c by Klimov Paul

Test case "YiiRequirementCheckerTest::testCheckEval()" has been added.

parent 00d04a1c
...@@ -55,4 +55,33 @@ class YiiRequirementCheckerTest extends TestCase ...@@ -55,4 +55,33 @@ class YiiRequirementCheckerTest extends TestCase
$this->assertEquals(false, $checkedRequirements['requirementWarning']['error'], 'Error requirement has an error!'); $this->assertEquals(false, $checkedRequirements['requirementWarning']['error'], 'Error requirement has an error!');
$this->assertEquals(true, $checkedRequirements['requirementWarning']['warning'], 'Error requirement has no warning!'); $this->assertEquals(true, $checkedRequirements['requirementWarning']['warning'], 'Error requirement has no warning!');
} }
public function testCheckEval() {
$requirementsChecker = new YiiRequirementChecker();
$requirements = array(
'requirementPass' => array(
'name' => 'Requirement 1',
'mandatory' => true,
'condition' => 'eval:2>1',
'by' => 'Requirement 1',
'memo' => 'Requirement 1',
),
'requirementError' => array(
'name' => 'Requirement 2',
'mandatory' => true,
'condition' => 'eval:2<1',
'by' => 'Requirement 2',
'memo' => 'Requirement 2',
),
);
$checkResult = $requirementsChecker->check($requirements)->getResult();
$checkedRequirements = $checkResult['requirements'];
$this->assertEquals(false, $checkedRequirements['requirementPass']['error'], 'Passed requirement has an error!');
$this->assertEquals(false, $checkedRequirements['requirementPass']['warning'], 'Passed requirement has a warning!');
$this->assertEquals(true, $checkedRequirements['requirementError']['error'], 'Error requirement has no error!');
}
} }
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