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

Commit

Permalink
Better readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
defenestrator committed Mar 15, 2018
1 parent dbf9fb5 commit 605a2ec
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,35 @@ Copacetic Test Printer

Rather than see a string of dots and letters, get some darn information as your tests are running.

![](https://raw.githubusercontent.com/copacetic/test-printer/master/assets/images/screenshot.jpg)
![](https://raw.githubusercontent.com/copacetic-co/test-printer/master/assets/images/screenshot.jpg)

## Installation

Install TestResultPrinter class with composer:

`composer require verysimple/unit-test-printer`
composer require --dev copacetic/test-printer

For automatic installation, include the project in your composer.json (it is only necessary in require-dev):

```json
{
"require-dev": {
"verysimple/unit-test-printer": ">=1.0.1"
"copacetic/test-printer": ">=1.0.1"
}
}
```

If you do not use composer, you can download and save `VerboseTestResultPrinter.php` wherever you want,
but you should seriously use composer, dork.
If you don't use composer, you can download and save `TestResultPrinter.php` wherever you want.
You should seriously use composer, dork.

## Usage

To use the `VerboseTestResultPrinter` class, it is specified in your `phpunit.xml` config file. The following assumes `phpunit.xml` is in your project root directory and your tests are located in a sub-directory named "tests".
To use the `TestResultPrinter` class, specify it in the phpunit element of `phpunit.xml` config file.

<phpunit
colors="true"
printerClass="Verysimple\UnitTest\VerboseTestResultPrinter"
printerFile="vendor/autoload.php"
printerClass="Copacetic\TestResultPrinter"
>
<testsuite name="Default Tests">
<directory>tests/</directory>
</testsuite>
...
</phpunit>

Alternatively you can add simply make sure the library is included in your test runner. For example, adding the following to your `phpunit_bootstrap.php file`:

`require __DIR__.'/vendor/autoload.php';`

To run unit tests, execute phpunit from the root directory of the project.

0 comments on commit 605a2ec

Please sign in to comment.