public function testSinglestepMedianRunOutput() { $xmlGenerator = new XmlResultGenerator($this->testInfoMock, "https://unitTest", $this->fileHandlerMock, $this->allAdditionalInfo, true); $xmlGenerator->printMedianRun($this->testResultMock); $expectedXmlFile = __DIR__ . '/data/singlestepMedianOutput.xml'; $this->assertThat(ob_get_contents(), IsCompatibleXMLConstraint::fromFile($expectedXmlFile)); }
public function testPrintMedianRunMultistep() { $run = $this->getTestRunResults(3); $xmlGenerator = new XmlResultGenerator($this->testInfo, "", new FileHandler(), $this->xmlInfoDomainBreakdown, true); $xmlGenerator->printMedianRun($run); $xml = simplexml_load_string(ob_get_contents()); $this->assertEquals("2", $xml->run); $this->assertEquals("900", $xml->TTFB); $this->assertEquals("9000", $xml->loadTime); $this->assertFalse(isset($xml->foo)); $this->assertFalse(isset($xml->domains)); }