示例#1
0
 /**
  * @test
  */
 public function violationsCanBeAdded()
 {
     $rule = new Rule('Dummy Rule', 'item.type == file');
     $item = new Item(new SplFileInfo('/a/fake/path/dummy.php', 'path/', 'path/dummy.php'), '/a/fake');
     $report = new Report();
     $report->addViolation($rule, $item);
     $violations = $report->getViolations();
     $this->assertCount(1, $violations);
     $this->assertTrue($report->hasViolations());
     $this->assertSame($rule, $violations[0]->getRule());
     $this->assertSame($item, $violations[0]->getItem());
 }