PHPackages                             vectorface/dunit - 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. vectorface/dunit

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

vectorface/dunit
================

Test code against multiple versions of PHP with the help of docker

v2.1.0(11y ago)25252.7k↓25%12[1 issues](https://github.com/Vectorface/dunit/issues)20MITPHP

Since Oct 22Pushed 10y ago18 watchersCompare

[ Source](https://github.com/Vectorface/dunit)[ Packagist](https://packagist.org/packages/vectorface/dunit)[ Docs](https://github.com/Vectorface/dunit)[ RSS](/packages/vectorface-dunit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (15)Used By (20)

DUnit
=====

[](#dunit)

DUnit (dee-unit) makes your life easier by allowing you to test your PHP code against multiple [Docker](https://www.docker.com/whatisdocker/) containers. This allows for testing your code against different versions of PHP or against different PHP configurations. By default, DUnit can perform a syntax check against your whole repository and run a [PHPUnit](https://phpunit.de/) test suite.

Default Containers
------------------

[](#default-containers)

DUnit includes preconfigured containers for the following PHP versions:

- PHP 5.2 (add `vectorface/php5.2` to your `.dunitconfig`)
- PHP 5.3
- PHP 5.4
- PHP 5.5
- PHP 5.6
- PHP 7.0-dev (add `vectorface/php-nightly` to your `dunitconfig`)
- HHVM stable
- HHVM nightly (add `vectorface/hhvm-nightly` to your `.dunitconfig`)

and has the following native extensions installed:

- apc (apcu on PHP 5.5 and newer)
- curl
- gd
- intl (PHP 5.3 and newer)
- json
- mcrypt

Installation
------------

[](#installation)

Simply run the following [composer](https://getcomposer.org/) command:

```
$ composer require vectorface/dunit --dev
```

It is highly recommended to copy the example config to your project root to control the default behaviour of the `dunit` command.

```
$ cp ./vendor/vectorface/dunit/dunitconfig.example ./.dunitconfig
```

And edit the file `.dunitconfig` to suit your tastes.

Usage
-----

[](#usage)

```
# run PHP syntax checks and your test suite against all supported version of PHP
$ ./vendor/bin/dunit

# show the help documentation
$ ./vendor/bin/dunit -h

# specify a custom configuration file
$ ./vendor/bin/dunit -c "path/.dunitconf"

# explictly specify which containers to use
$ ./vendor/bin/dunit -i "vectorface/php5.3 vectorface/php5.4"
```

Configuration
-------------

[](#configuration)

There are three ways to customize the `dunit` command:

- Environment variables
- Local config file
- Script flags.

### Environment variables

[](#environment-variables)

The following environment variables can be set to configure dunit.

- `DUNIT_IMAGES` - a string like "vectorface/php5.3 vectorface/php5.4" which indicates the list of images to run against.
- `DUNIT_PHPSYNTAX` - a `true`/`false` flag indicating whether dunit should run the syntax checks.
- `DUNIT_PHPSYNTAXCOMMAND` - a string indicating the exact command dunit should run to perform the syntax checks. This variable is ignored if `DUNIT_PHPSYNTAX` is set to `false`. Note that the command runs *inside* the Docker container and not on your host machine.
- `DUNIT_PHPUNIT` - a `true`/`false` flag indicating whether dunit should run PHPUnit.
- `DUNIT_PHPUNITCOMMAND` - a string indicating the exact command `dunit` should execute for the unit test suite. This variable is ignored if `DUNIT_PHPUNIT`is set to `false`. Note that the command runs *inside* the Docker container and not on your host machine.

#### Examples:

[](#examples)

Run `dunit` for versions 5.3 and 5.4 of PHP and skip the syntax check:

```
$ DUNIT_IMAGES="vectorface/php5.3 vectorface/php5.4" DUNIT_PHPSYNTAX=false ./vendor/bin/dunit
```

### Local config file (.dunitconfig)

[](#local-config-file-dunitconfig)

The `dunit` script will check for the presence of a local file named `.dunitconfig`. An example config file can be copied from the composer package:

```
$ cp ./vendor/vectorface/dunit/dunitconfig.example ./.dunitconfig
```

*The environment variables specified by the config file will override any variables passed directly to the script.*

### Script flags

[](#script-flags)

The `dunit` script can also take a number of flags. These flags will always override conflicting environment variable settings.

- `-h` - displays help information.
- `-c ./path/to/config` - `dunit` will use the config located at the provided path instead of looking in your local folder for `.dunitconfig`.
- `-i "image1 image2"` - `dunit` will only run against the specified images.
- `--version` - displays the current version.
- `-p` - pulls the latest version of all the docker images

#### Examples:

[](#examples-1)

Run `dunit` for versions 5.3 and 5.4 of PHP.

```
$ ./vendor/bin/dunit -i "vectorface/php5.3 vectorface/php5.4"
```

Run `dunit` with a custom config file.

```
$ ./vendor/bin/dunit -c ../dunit.global.conf
```

Upgrading from 1.x to 2.x
-------------------------

[](#upgrading-from-1x-to-2x)

The `.dunitconfig` syntax has changed entirely from version 1 to version 2 so it is required that you copy the new config file in place.

```
$ cp ./vendor/vectorface/dunit/dunitconfig.example ./.dunitconfig
```

and adjust your config accordingly.

Also note that DUnit no longer supports the environment variables `DUNIT_PHPVERSION` and `DUNIT_DOCKERIMAGE`. These variables have been merged as the variable `DUNIT_IMAGES`.

Similarly, the flag `-p` has been replaced by `-i`.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity46

Moderate usage in the ecosystem

Community32

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~13 days

Recently: every ~36 days

Total

13

Last Release

4066d ago

Major Versions

v0.3.0 → v1.0.02014-10-23

v1.4.0 → v2.0.02015-01-06

### Community

Maintainers

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

---

Top Contributors

[![ckdarby](https://avatars.githubusercontent.com/u/220283?v=4)](https://github.com/ckdarby "ckdarby (34 commits)")[![jdpanderson](https://avatars.githubusercontent.com/u/4468291?v=4)](https://github.com/jdpanderson "jdpanderson (13 commits)")[![danbruce](https://avatars.githubusercontent.com/u/562593?v=4)](https://github.com/danbruce "danbruce (3 commits)")[![vimishor](https://avatars.githubusercontent.com/u/477960?v=4)](https://github.com/vimishor "vimishor (1 commits)")

---

Tags

phptestingphpunitdocker

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vectorface-dunit/health.svg)

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

###  Alternatives

[blastcloud/guzzler

Supercharge your app or SDK with a testing library specifically for Guzzle.

272419.3k35](/packages/blastcloud-guzzler)[rregeer/phpunit-coverage-check

Check the code coverage using the clover report of phpunit

606.1M179](/packages/rregeer-phpunit-coverage-check)[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)[juampi92/test-seo

Easy way to test your SEO

26341.0k](/packages/juampi92-test-seo)[robiningelbrecht/phpunit-coverage-tools

PHPUnit coverage tools

1783.0k34](/packages/robiningelbrecht-phpunit-coverage-tools)

PHPackages © 2026

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