예제 #1
0
 /**
  * @param array $expected
  * @param array $report
  * @param array $filesStats
  *
  * @dataProvider casesReports
  */
 public function testAll(array $expected, array $report, array $filesStats)
 {
     $rw = new ReportWrapper($report);
     $this->tester->assertEquals($expected['countFiles'], $rw->countFiles());
     $this->tester->assertEquals($expected['numOfErrors'], $rw->numOfErrors());
     $this->tester->assertEquals($expected['numOfWarnings'], $rw->numOfWarnings());
     $this->tester->assertEquals($expected['highestSeverity'], $rw->highestSeverity());
     /**
      * @var string $filePath
      * @var \Cheppers\Robo\ScssLint\LintReportWrapper\FileWrapper $fw
      */
     foreach ($rw->yieldFiles() as $filePath => $fw) {
         $fileStats = $filesStats[$filePath];
         $this->tester->assertEquals($filePath, $fw->filePath());
         $this->tester->assertEquals($fileStats['numOfErrors'], $fw->numOfErrors());
         $this->tester->assertEquals($fileStats['numOfWarnings'], $fw->numOfWarnings());
         $this->tester->assertEquals($fileStats['highestSeverity'], $fw->highestSeverity());
         $this->tester->assertEquals($fileStats['stats'], $fw->stats());
         /**
          * @var int $i
          * @var \Cheppers\LintReport\FailureWrapperInterface $failureWrapper
          */
         foreach ($fw->yieldFailures() as $i => $failureWrapper) {
             $failure = $report[$filePath][$i];
             $this->tester->assertEquals($failure['severity'], $failureWrapper->severity());
             $this->tester->assertEquals($failure['linter'], $failureWrapper->source());
             $this->tester->assertEquals($failure['line'], $failureWrapper->line());
             $this->tester->assertEquals($failure['column'], $failureWrapper->column());
             $this->tester->assertEquals($failure['reason'], $failureWrapper->message());
         }
     }
 }