PHPackages                             task/phpunit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. task/phpunit

ActiveLibrary[Testing &amp; Quality](/categories/testing)

task/phpunit
============

PHPUnit plugin for Task

v0.3.3(11y ago)01.4k5MITPHPPHP &gt;=5.4.0

Since Apr 23Pushed 11y ago2 watchersCompare

[ Source](https://github.com/taskphp/phpunit)[ Packagist](https://packagist.org/packages/task/phpunit)[ RSS](/packages/task-phpunit/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (7)Versions (7)Used By (5)

task/phpunit
============

[](#taskphpunit)

[![Build Status](https://camo.githubusercontent.com/6b856ffc8ed679264d173f5161ce308970e60b4224a58c63f27922f54edebbc0/68747470733a2f2f7472617669732d63692e6f72672f7461736b7068702f706870756e69742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/taskphp/phpunit)[![Coverage Status](https://camo.githubusercontent.com/d8b161c2e7cdf3fd4d603f8c6aa28f3071f58ec0274874db30b4b1ffd164128a/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7461736b7068702f706870756e69742f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/taskphp/phpunit?branch=master)

Installation
============

[](#installation)

Install via Composer:

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

Example
=======

[](#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
=====

[](#usage)

Given:

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

#### setTestCase

[](#settestcase)

```
->setTestCase('MyTest')
```

```
$> phpunit MyTest
```

#### setTestFile

[](#settestfile)

```
->setTestFile('MyTest.php')
```

```
$> phpunit MyTest.php
```

#### useColors

[](#usecolors)

```
->useColors()
```

```
$> phpunit --colors
```

#### setBootstrap

[](#setbootstrap)

```
->setBootstrap('bootstrap.php')
```

```
$> phpunit --bootstrap bootstrap.php
```

#### setConfiguration

[](#setconfiguration)

```
->setConfiguration('phpunit.xml')
```

```
$> phpunit --configuration phpunit.xml
```

#### addCoverage

[](#addcoverage)

```
->addCoverage('html')
```

```
$> phpunit --coverage-html
```

#### setInitValue

[](#setinitvalue)

```
->setIniValue('foo', 'bar')
```

```
$> phpunit -d foo=bar
```

#### useDebug

[](#usedebug)

```
->useDebug()
```

```
$> phpunit --debug
```

#### setFilter

[](#setfilter)

```
->setFilter('/foo/')
```

```
$> phpunit --filter /foo/
```

#### setTestsuite

[](#settestsuite)

```
->setTestsuite('unit')
```

```
$> phpunit --testsuite unit
```

#### addGroups

[](#addgroups)

```
->addGroups(['foo', 'bar'])
```

```
$> phpunit --group foo,bar
```

#### excludeGroups

[](#excludegroups)

```
->excludeGroups(['foo', 'bar'])
```

```
$> phpunit --exclude-group foo,bar
```

#### addTestSuffixes

[](#addtestsuffixes)

```
->addTestSuffixes(['.phpt', '.php'])
```

```
$> phpunit --test-suffix .phpt,.php
```

#### setIncludePath

[](#setincludepath)

```
->setIncludePath('./src')
```

```
$> phpunit --include-path ./src
```

#### setPrinter

[](#setprinter)

```
->setPrinter('MyPrinter')
```

```
$> phpunit --printer MyPrinter
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Total

6

Last Release

4313d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a2690beef16c00adcf9d21b025550c9b6fda653cfd57b5f99db279c459fb77ae?d=identicon)[mbfisher](/maintainers/mbfisher)

---

Top Contributors

[![mbfisher](https://avatars.githubusercontent.com/u/1162326?v=4)](https://github.com/mbfisher "mbfisher (10 commits)")

### Embed Badge

![Health badge](/badges/task-phpunit/health.svg)

```
[![Health](https://phpackages.com/badges/task-phpunit/health.svg)](https://phpackages.com/packages/task-phpunit)
```

###  Alternatives

[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[jasonmccreary/laravel-test-assertions

A set of helpful assertions when testing Laravel applications.

3513.9M32](/packages/jasonmccreary-laravel-test-assertions)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[typo3/testing-framework

The TYPO3 testing framework provides base classes for unit, functional and acceptance testing.

675.0M775](/packages/typo3-testing-framework)[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
