Пример #1
0
 public function evaluate(KnowledgeState $state)
 {
     $state_value = $state->value($this->name);
     if ($state_value instanceof Maybe) {
         return $state_value;
     }
     return $state_value == $this->value ? Yes::because([$this->name]) : No::because([$this->name]);
 }
Пример #2
0
 /**
  * @dataProvider invalidNoProvider
  */
 public function testShouldNotValidatePatternAccordingToTheDefinedLocale($input)
 {
     $rule = new No();
     $this->assertFalse($rule->validate($input));
 }