/**
  * @return string
  */
 public function toXml()
 {
     return sprintf('<error type="%s">%s</error>', Utils::encodeXml($this->getType()), Utils::cdata($this->getMessage()));
 }
 /**
  * @return string
  */
 public function toXml()
 {
     $content = "";
     foreach ($this->getTestCases() as $testCase) {
         $content .= (string) $testCase->toXml();
     }
     foreach ($this->getTestSuites() as $testSuite) {
         $content .= (string) $testSuite->toXml();
     }
     return sprintf('<testsuite name="%s" tests="%d" assertions="%d" namespace="%s" fullsPackage="%s" failures="%d" errors="%d" time="%.6f">%s</testsuite>', Utils::encodeXml($this->getName()), $this->countTests(), $this->getAssertions(), Utils::encodeXml($this->getNamespace()), Utils::encodeXml($this->getFullPackage()), $this->getFailures(), $this->getErrors(), $this->getTime(), $content);
 }
 /**
  * @return string
  */
 public function toXml()
 {
     $inner = "";
     if ($this->getError()) {
         $inner .= $this->getError();
     }
     if ($this->getFailure()) {
         $inner .= $this->getFailure();
     }
     return sprintf('<testcase name="%s" class="%s" file="%s" line="%d" assertions="%d" time="%.6f"%s', Utils::encodeXml($this->getName()), Utils::encodeXml($this->getClass()), Utils::encodeXml($this->getFile()), $this->getLine(), $this->getAssertions(), $this->getTime(), $inner ? sprintf(">%s</testcase>", $inner) : "/>");
 }