Example #1
0
 /**
  * Check page rules
  *
  * @param Subject $subject
  *
  * @return ResultCollection
  */
 public function check(Subject $subject) : ResultCollection
 {
     $ruleCollection = new RuleCollection();
     $ruleCollection->add(new TitleRule());
     $ruleCollection->add(new ImageRule());
     return $ruleCollection->check($subject);
 }
Example #2
0
 /**
  * @covers ::add
  */
 public function testAdd()
 {
     /**
      * @var RuleInterface $rule
      */
     $rule = $this->getMock(RuleInterface::class);
     $ruleCollection = new RuleCollection();
     $this->assertSame(0, $ruleCollection->count());
     $ruleCollection->add($rule);
     $this->assertSame(1, $ruleCollection->count());
 }