Browse Source

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

tags/2.0.0-beta
Klimov Paul 12 years ago
parent
commit
3b7ac70c69
  1. 29
      tests/unit/framework/requirements/YiiRequirementCheckerTest.php

29
tests/unit/framework/requirements/YiiRequirementCheckerTest.php

@ -55,4 +55,33 @@ class YiiRequirementCheckerTest extends TestCase
$this->assertEquals(false, $checkedRequirements['requirementWarning']['error'], 'Error requirement has an error!');
$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!');
}
}

Loading…
Cancel
Save