Esempio n. 1
0
 /**
  * Add rule
  *
  * @param RuleOverride $ruleOverride Rule override to add
  *
  * @throws \DomainException
  *
  * @return RuleSet
  */
 public function addRuleOverride(RuleOverride $ruleOverride)
 {
     if (array_key_exists($ruleOverride->getName(), $this->ruleOverride)) {
         throw new \DomainException("No duplicates rule override allowed");
     }
     $this->ruleOverride[$ruleOverride->getName()] = $ruleOverride;
     return $this;
 }
Esempio n. 2
0
 public function testWhy()
 {
     $override = new base('test', true);
     $this->object($override->setWhy('why test'))->isInstanceOf('MojoLyon\\Axiom\\RuleOverride')->string($override->getWhy())->isEqualTo('why test');
 }