コード例 #1
0
 public function testGreaterThenNumericFalse()
 {
     $rule = new GreaterThan();
     $rule->setConfig(5);
     $result = $rule->execute(4);
     $this->assertInstanceOf(RuleExecutionResult::class, $result, 'Rule must return RuleExecutionResult object');
     $this->assertFalse($result->isSuccess(), '4 must be < 6');
 }
コード例 #2
0
 protected function createTestGirl()
 {
     $boobsSize = new Property('boobsSize');
     $greaterThenRule = new GreaterThan();
     $greaterThenRule->setConfig(2);
     $boobsSize->addPropertyRule($greaterThenRule);
     $prettyFace = new Property('prettyFace');
     $prettyFace->addPropertyRule(new AlwaysTrueRule());
     $girl = new CompositeProperty('girl');
     $girl->addProperty($boobsSize);
     $girl->addProperty($prettyFace);
     return $girl;
 }
コード例 #3
0
 public function createGreaterThanRule()
 {
     $rule = new GreaterThan();
     $rule->setConfig(3);
     return $rule;
 }