Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
Add full documentation in ReadMe
Browse files Browse the repository at this point in the history
  • Loading branch information
llaumgui committed Jun 2, 2015
1 parent 91f4886 commit 3f73b02
Showing 1 changed file with 48 additions and 6 deletions.
54 changes: 48 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,65 @@
# JunitXml
[![Build Status branch master](https://travis-ci.org/llaumgui/JunitXml.svg?branch=master)](https://travis-ci.org/llaumgui/JunitXml) [![Code Climate](https://codeclimate.com/github/llaumgui/JunitXml/badges/gpa.svg)](https://codeclimate.com/github/llaumgui/JunitXml) [![Test Coverage](https://codeclimate.com/github/llaumgui/JunitXml/badges/coverage.svg)](https://codeclimate.com/github/llaumgui/JunitXml/coverage)
[![Build Status branch master](https://travis-ci.org/llaumgui/JunitXml.svg?branch=master)](https://travis-ci.org/llaumgui/JunitXml) [![Code Climate](https://codeclimate.com/github/llaumgui/JunitXml/badges/gpa.svg)](https://codeclimate.com/github/llaumgui/JunitXml) [![Test Coverage](https://codeclimate.com/github/llaumgui/JunitXml/badges/coverage.svg)](https://codeclimate.com/github/llaumgui/JunitXml/coverage) [![PHP version](https://badge.fury.io/ph/llaumgui%2Fjunit-xml.svg)](https://packagist.org/packages/llaumgui/junit-xml)

PHP library for generate XML document in JUnit format.



## Installation
~~~php
composer require 'llaumgui/junit-xml:dev-master'
~~~


## API
See [documentation](https://llaumgui.github.io/JunitXml/).
## API documentation
See [JunitXml API Documentation](https://llaumgui.github.io/JunitXml/).


## Usage
* Create a new TestSuites:
* Create a new *TestSuites*:
~~~php
$testSuites = new JunitXmlTestSuites('My testsuites');
~~~
* Add a *TestSuite* to the *TestSuites*:
~~~php
$testSuite1 = $testSuites->addTestSuite('My testsuite #1');
~~~
* Add a *TestCase* to the *TestSuite*:
~~~php
$test1 = $testSuite1->addTest('Check if blabla is good');
~~~
* Increment the *assertion* number of the *TestCase*:
~~~php
$testSuites = new JunitXmlTestSuites();
$test1->incAssertions();
~~~
* Mark test as *skipped*:
~~~php
$test1->addSkipped('Skipped because blabla.');
~~~
* Mark test in error:
~~~php
$test1->addError('Error message', 'error_type');
~~~
* Mark test as fail:
~~~php
$test1->addFailure('Fail message', 'fail_type');
~~~
* Finish and close test:
~~~php
$test1->finish();
~~~
* Finish and close TestSuite:
~~~php
$testSuite->finish();
~~~
* Finish, close and get XML of the TestSuites:
~~~php
$testSuites->getXml();
~~~

* For full documentation: see [JunitXml API Documentation](https://llaumgui.github.io/JunitXml/)
* For full exemple: see [tests/JunitXmlTestCaseTest.php](https://github.com/llaumgui/JunitXml/blob/master/tests/JunitXmlTestCaseTest.php)


## License
Released under the [MIT license](http://www.opensource.org/licenses/MIT).

0 comments on commit 3f73b02

Please sign in to comment.