PHP Class ParaTest\Logging\JUnit\Writer

Show file Open project: brianium/paratest Class Usage Examples

Protected Properties

Property Type Description
$caseAttrs string A pattern for matching testcase attrs
$defaultSuite array A default suite to ease flattening of suite structures
$document DOMDocument
$interpreter ParaTest\Logging\LogInterpreter
$name string The name attribute of the testsuite being written
$suiteAttrs string A pattern for matching testsuite attributes

Public Methods

Method Description
__construct ( LogInterpreter $interpreter, $name = '' )
getName ( ) : string Get the name of the root suite being written
getXml ( ) : string Returns the xml structure the writer will use
write ( $path ) Write the xml structure to a file path

Protected Methods

Method Description
appendCase ( $suiteNode, TestCase $case ) : DOMElement Append a testcase node to the given testsuite node
appendDefects ( $caseNode, $defects, $type ) Append error or failure nodes to the given testcase node
appendSuite ( $root, ParaTest\Logging\JUnit\TestSuite $suite ) : DOMElement Append a testsuite node to the given root element
getSuiteRoot ( $suites ) : DOMElement Get the root level testsuite node
getSuiteRootAttributes ( $suites ) : mixed Get the attributes used on the root testsuite node

Private Methods

Method Description
isEmptyLineAttribute ( string $name, mixed $value ) : boolean Prevent writing empty "line" XML attributes which could break parsers.

Method Details

__construct() public method

public __construct ( LogInterpreter $interpreter, $name = '' )
$interpreter ParaTest\Logging\LogInterpreter

appendCase() protected method

Append a testcase node to the given testsuite node
protected appendCase ( $suiteNode, TestCase $case ) : DOMElement
$suiteNode
$case TestCase
return DOMElement

appendDefects() protected method

Append error or failure nodes to the given testcase node
protected appendDefects ( $caseNode, $defects, $type )
$caseNode
$defects
$type

appendSuite() protected method

Append a testsuite node to the given root element
protected appendSuite ( $root, ParaTest\Logging\JUnit\TestSuite $suite ) : DOMElement
$root
$suite ParaTest\Logging\JUnit\TestSuite
return DOMElement

getName() public method

Get the name of the root suite being written
public getName ( ) : string
return string

getSuiteRoot() protected method

Get the root level testsuite node
protected getSuiteRoot ( $suites ) : DOMElement
$suites
return DOMElement

getSuiteRootAttributes() protected method

Get the attributes used on the root testsuite node
protected getSuiteRootAttributes ( $suites ) : mixed
$suites
return mixed

getXml() public method

Returns the xml structure the writer will use
public getXml ( ) : string
return string

write() public method

Write the xml structure to a file path
public write ( $path )
$path

Property Details

$caseAttrs protected static property

A pattern for matching testcase attrs
protected static string $caseAttrs
return string

$defaultSuite protected static property

A default suite to ease flattening of suite structures
protected static array $defaultSuite
return array

$document protected property

protected DOMDocument $document
return DOMDocument

$interpreter protected property

protected LogInterpreter,ParaTest\Logging $interpreter
return ParaTest\Logging\LogInterpreter

$name protected property

The name attribute of the testsuite being written
protected string $name
return string

$suiteAttrs protected static property

A pattern for matching testsuite attributes
protected static string $suiteAttrs
return string