/**
  * @param string $text
  * @param string $type
  * @param string $failureOrError
  */
 protected function writeFailureOrError($text, $type, $failureOrError)
 {
     $error = $this->xmlWriter->createElement($failureOrError, $this->utf8Converter->convert($text));
     $this->getCurrentElement()->appendChild($error);
     if (!is_null($type)) {
         $error->setAttribute('type', $this->utf8Converter->convert($type));
     }
     $this->getCurrentTestsuite()->{'increase' . $failureOrError . 'Count'}();
 }
Ejemplo n.º 2
0
 /**
  * @param string $text
  * @param string $type
  * @param string $failureOrError
  */
 protected function writeFailureOrError($text, $type, $failureOrError)
 {
     $error = $this->xmlWriter->createElement($failureOrError, htmlspecialchars($text, ENT_QUOTES, 'UTF-8'));
     // TODO Since the DOM implementation ignores ENT_QUOTES, single quotes and double quotes is output as is.
     $this->getCurrentElement()->appendChild($error);
     if (!is_null($type)) {
         $error->setAttribute('type', $this->utf8Converter->convert($type));
     }
     $this->getCurrentTestsuite()->{'increase' . $failureOrError . 'Count'}();
 }
 /**
  * @param string $text
  * @param string $type
  * @param string $failureOrError
  */
 protected function writeFailureOrError($text, $type, $failureOrError)
 {
     $this->xmlWriter->startElement($failureOrError);
     if (!is_null($type)) {
         $this->xmlWriter->writeAttribute('type', $this->utf8Converter->convert($type));
     }
     $this->xmlWriter->text($this->utf8Converter->convert($text));
     $this->xmlWriter->endElement();
     $this->flush();
 }