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]); }
/** * @dataProvider invalidNoProvider */ public function testShouldNotValidatePatternAccordingToTheDefinedLocale($input) { $rule = new No(); $this->assertFalse($rule->validate($input)); }