/** * Empty line attributes, e.g. line="" breaks Jenkins parsing since it needs to be an integer. * To repair, ensure that empty line attributes are actually written as 0 instead of empty string. */ public function testThatEmptyLineAttributesConvertToZero() { $mixed = FIXTURES . DS . 'results' . DS . 'junit-example-result.xml'; $reader = new Reader($mixed); $this->interpreter->addReader($reader); $writer = new Writer($this->interpreter, "test/fixtures/tests/"); $xml = $writer->getXml(); $this->assertFalse(strpos($xml, 'line=""'), 'Expected no empty line attributes (line=""), but found one.'); }
public function testMixedFileLog() { $mixed = FIXTURES . DS . 'results' . DS . 'mixed-results.xml'; $reader = new Reader($mixed); $this->interpreter->addReader($reader); $writer = new Writer($this->interpreter, "test/fixtures/tests/"); $xml = $writer->getXml(); $this->assertXmlStringEqualsXmlString(file_get_contents($mixed), $xml); }
/** * Write output to JUnit format if requested */ private function log() { if (!isset($this->options->filtered['log-junit'])) { return; } $output = $this->options->filtered['log-junit']; $writer = new Writer($this->interpreter, $this->options->path); $writer->write($output); }