예제 #1
0
 private function checkRule(Rule $rule, Report $report)
 {
     $items = $this->getItemManager()->getItems($rule->getInclude(), $rule->getExclude());
     foreach ($items as $item) {
         $rule->check($item, $report);
     }
 }
예제 #2
0
 /**
  * @test
  * @expectedException Symfony\Component\ExpressionLanguage\SyntaxError
  * @expectedExceptionMessage Unexpected character """ around position 12.
  */
 public function checkRuleUsingInvalidExpressionThrowsAnException()
 {
     $file = new SplFileInfo(vfsStream::url('root/bin/check.sh'), 'bin', 'bin/check.sh');
     $item = new Item($file, vfsStream::url('root'));
     $report = new Report();
     // Note the missing double quote after bar
     $rule = new Rule('Rule name', 'item.foo == "bar');
     $rule->check($item, $report);
 }