/** * @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 * @param string $file * @param string $line * @param string $message */ protected function writeFailureOrError($text, $type, $failureOrError, $file, $line, $message) { $this->xmlWriter->startElement($failureOrError); if (!is_null($type)) { $this->xmlWriter->writeAttribute('type', $this->utf8Converter->convert($type)); } if (!is_null($file)) { $this->xmlWriter->writeAttribute('file', $this->utf8Converter->convert($file)); } if (!is_null($line)) { $this->xmlWriter->writeAttribute('line', $line); } if (!is_null($message)) { $this->xmlWriter->writeAttribute('message', $this->utf8Converter->convert($message)); } $this->xmlWriter->text($this->utf8Converter->convert($text)); $this->xmlWriter->endElement(); $this->flush(); }