ParaTest\Logging\JUnit\TestCase::caseFromNode PHP Method

caseFromNode() public static method

Factory method that creates a TestCase object from a SimpleXMLElement
public static caseFromNode ( SimpleXMLElement $node ) : TestCase
$node SimpleXMLElement
return TestCase
    public static function caseFromNode(\SimpleXMLElement $node)
    {
        $case = new TestCase((string) $node['name'], (string) $node['class'], (string) $node['file'], (string) $node['line'], (string) $node['assertions'], (string) $node['time']);
        $node = self::addSystemOut($node);
        $failures = $node->xpath('failure');
        $errors = $node->xpath('error');
        while (list(, $fail) = each($failures)) {
            $case->addFailure((string) $fail['type'], (string) $fail);
        }
        while (list(, $err) = each($errors)) {
            $case->addError((string) $err['type'], (string) $err);
        }
        return $case;
    }