Generates JUnit XML files
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/N98/JUnitXml
tests
.gitignore
.travis.yml
MIT-LICENSE.txt
README.rst
composer.json
phpunit.xml

README.rst

JUnit XML Document Generator Library

https://secure.travis-ci.org/cmuench/junit-xml.png

Install component with composer.

{
    "require": {
        "n98/junit-xml": "dev-master"
    }
}

Example

require_once __DIR__ . '/../vendor/autoload.php';

$document = new \N98\JUnitXml\Document();

$suite = $this->document->addTestSuite();
$timeStamp = new \DateTime();
$suite->setName('My Test Suite');
$suite->setTimestamp($timeStamp);
$suite->setTime(0.344244);

$testCase = $suite->addTestCase();
$testCase->addError('My error 1', 'Exception');
$testCase->addError('My error 2', 'Exception');
$testCase->addError('My error 3', 'Exception');
$testCase->addError('My error 4', 'Exception');
$testCase->addFailure('My failure 1', 'Exception');
$testCase->addFailure('My failure 2', 'Exception');

$document->save('results.xml');