2017 © Pedro Peláez
 

library phpunit

PHPUnit plugin for Task

image

task/phpunit

PHPUnit plugin for Task

  • Sunday, July 27, 2014
  • by mbfisher
  • Repository
  • 2 Watchers
  • 0 Stars
  • 1,322 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

task/phpunit

Build Status Coverage Status, (*1)

Installation

Install via Composer:, (*2)

...
    "require-dev": {
        "task/phpunit": "~0.2"
    }
...

Example

use Task\Plugin\PHPUnitPlugin;

$project->inject(function ($container) {
    $container['phpunit'] = new PHPUnitPlugin;
});

$project->addTask('phpunit', ['phpunit', function ($phpunit) {
    $phpunit->getCommand()
        ->useColors()
        ->setBootstrap('tests/bootstrap.php')
        ->pipe($this->getOutput());
}]);

Usage

Given:, (*3)

$project->addTask('phpunit', ['phpunit', function ($phpunit) {
    $phpunit->getCommand()
    ...

setTestCase

->setTestCase('MyTest')
$> phpunit MyTest


#### setTestFile
```php
->setTestFile('MyTest.php')
```bash $> phpunit MyTest.php
#### useColors
```php
->useColors()
```bash $> phpunit --colors
#### setBootstrap
```php
->setBootstrap('bootstrap.php')
```bash $> phpunit --bootstrap bootstrap.php
#### setConfiguration
```php
->setConfiguration('phpunit.xml')
```bash $> phpunit --configuration phpunit.xml
#### addCoverage
```php
->addCoverage('html')
```bash $> phpunit --coverage-html
#### setInitValue
```php
->setIniValue('foo', 'bar')
```bash $> phpunit -d foo=bar
#### useDebug
```php
->useDebug()
```bash $> phpunit --debug
#### setFilter
```php
->setFilter('/foo/')
```bash $> phpunit --filter /foo/
#### setTestsuite
```php
->setTestsuite('unit')
```bash $> phpunit --testsuite unit
#### addGroups
```php
->addGroups(['foo', 'bar'])
```bash $> phpunit --group foo,bar
#### excludeGroups
```php
->excludeGroups(['foo', 'bar'])
```bash $> phpunit --exclude-group foo,bar
#### addTestSuffixes
```php
->addTestSuffixes(['.phpt', '.php'])
```bash $> phpunit --test-suffix .phpt,.php
#### setIncludePath
```php
->setIncludePath('./src')
```bash $> phpunit --include-path ./src
#### setPrinter
```php
->setPrinter('MyPrinter')
```bash $> phpunit --printer MyPrinter

The Versions

27/07 2014
27/07 2014
04/05 2014
01/05 2014

v0.2.0

0.2.0.0

PHPUnit plugin for Task

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mike Fisher

23/04 2014

v0.1.0

0.1.0.0

PHPUnit plugin for Task

  Sources   Download

MIT

The Requires

 

by Mike Fisher