mneudert / junit-scribe
Utility to write JUnit XML Documents.
Installs: 138
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/mneudert/junit-scribe
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: 4.0
This package is not auto-updated.
Last update: 2025-10-11 21:53:52 UTC
README
Utility to write JUnit XML Documents.
Installation
Installation can be done using composer:
{
"require": {
"mneudert/junit-scribe": "dev-master"
}
}
Or simply include in using your favorite autoloading solution.
Usage
use JUnitScribe\Document; use JUnitScribe\Writer\StringWriter; $document = new Document(); $document ->addSuite() ->setName('SuiteAllOk') ->addCase() ->setName('SomeAssertions') ->setAssertions(10) ->setTime(0.1236) ->getParent() ->addCase() ->setName('MoreAssertiongs') ->setAssertions(7) ->setTime(0.2242) ->getParent() ->getParent() ->addSuite() ->setName('SuiteNotOk') ->addCase() ->setName('HasError') ->setAssertions(9) ->setTime(1.4424) ->addError() ->setMessage('An Error Occurred.') ->setMessageBody('Some lengthy stacktrace or message body for the error.') ->getParent() ->getParent() ->addCase() ->setName('HasFailure') ->setAssertions(7) ->setTime(1.0023) ->addFailure() ->setMessage('A Failure Occurred.') ->setMessageBody('Some lengthy stacktrace or message body for the failure.'); $writer = new StringWriter(); $writer->setDocument($document); echo $writer->formatDocument();
License
JUnitScribe is licensed under the MIT License - see the LICENSE file for details.