protected function appendCase(\DOMElement $suiteNode, TestCase $case): \DOMElement
    {
        $caseNode = $this->document->createElement('testcase');
        $vars = get_object_vars($case);
        foreach ($vars as $name => $value) {
            if (preg_match(static::$caseAttrs, $name)) {
                if ($this->isEmptyLineAttribute($name, $value)) {
                    continue;
                }
                $caseNode->setAttribute($name, (string) $value);
            }
        }
        $suiteNode->appendChild($caseNode);
        $this->appendDefects($caseNode, $case->failures, 'failure');
        $this->appendDefects($caseNode, $case->errors, 'error');

        return $caseNode;
    }