/** * Extracts the test data for a single log file and tests the result. * * @param DOMXPath $xpath The xpath instance for the log file. * * @return void */ protected function doTestSingleLog(DOMXPath $xpath) { $log = $this->queryLogData($xpath); $input = new phpucUnitCoverageInput(); $input->processLog($xpath); $data = $input->data; $this->assertArrayHasKey('Executable', $data); $this->assertArrayHasKey('Covered', $data); $this->assertEquals($log['Executable'], reset($data['Executable'])); $this->assertEquals($log['Covered'], reset($data['Covered'])); }
/** * Tests that the chart factory creates a line chart for a coverage input. * * @return void */ public function testCreateLineChartFromUnitCoverage() { $this->markTestSkippedWhenEzcGraphChartNotExists(); $input = new phpucUnitCoverageInput(); $input->processLog(new DOMXPath(new DOMDocument())); $factory = new phpucChartFactory(); $chart = $factory->createChart($input); $this->assertType('phpucLineChart', $chart); }