ParaTest\Logging\JUnit\Writer::getXml PHP Метод

getXml() публичный Метод

Returns the xml structure the writer will use
public getXml ( ) : string
Результат string
    public function getXml()
    {
        $suites = $this->interpreter->flattenCases();
        $root = $this->getSuiteRoot($suites);
        foreach ($suites as $suite) {
            $snode = $this->appendSuite($root, $suite);
            foreach ($suite->cases as $case) {
                $cnode = $this->appendCase($snode, $case);
            }
        }
        return $this->document->saveXML();
    }

Usage Example

Пример #1
0
 /**
  * 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.');
 }
All Usage Examples Of ParaTest\Logging\JUnit\Writer::getXml