PHPackages                             thomasnordahldk/tester - 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. thomasnordahldk/tester

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

thomasnordahldk/tester
======================

An object oriented approach to testing for PHP.

0.3.1(8y ago)026MITPHPPHP &gt;=7.1

Since Sep 29Pushed 8y ago1 watchersCompare

[ Source](https://github.com/thomasnordahl-dk/tester)[ Packagist](https://packagist.org/packages/thomasnordahldk/tester)[ RSS](/packages/thomasnordahldk-tester/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (7)Used By (0)

thomasnordahldk/tester
======================

[](#thomasnordahldktester)

[![PHP Version](https://camo.githubusercontent.com/e6556d680d7fcf917890d04219d10f99ae03b29748d031fba63cb2e2538efeea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e312532422d626c75652e737667)](https://packagist.org/packages/thomasnordahldk/tester)[![Latest Stable Version](https://camo.githubusercontent.com/a02652586fade57f71c5237deb26bdf21edddd8975e654a86cdbcbcb05aa8b7d/68747470733a2f2f706f7365722e707567782e6f72672f74686f6d61736e6f726461686c646b2f7465737465722f762f737461626c65)](https://packagist.org/packages/thomasnordahldk/tester)[![License](https://camo.githubusercontent.com/bbb3e12ab599a8de73c30be9cbad8d9a9c3264f987082b82f40a96879478b243/68747470733a2f2f706f7365722e707567782e6f72672f74686f6d61736e6f726461686c646b2f7465737465722f6c6963656e7365)](https://packagist.org/packages/thomasnordahldk/tester)[![Build Status](https://camo.githubusercontent.com/3d785b40d4689f539eb8063e854994afd187eebba08416c4ca1b88ba40e49f84/68747470733a2f2f7472617669732d63692e6f72672f74686f6d61736e6f726461686c2d646b2f7465737465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/thomasnordahl-dk/tester)

*An object oriented approach to testing PHP code.*

*Tester* aims to be: easy to learn, light weight, object oriented, and extensible.

[Documentation here](docs/index.md)

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

[](#installation)

The library is released as a composer package.

```
composer require --dev thomasnordahldk/tester

```

Tests
-----

[](#tests)

Tests are defined by creating `TestCase` classes.

```
class MyTestCase implements TestCase
{
    public function getDescription(): string
    {
        return "My new unit test";
    }

    public function run(Tester $tester): void
    {
        $tester->assert(true, "This assertion passes!");
        $tester->assert(false, "This assertion fails!");
    }
}
```

The test case is defined as **a description of the test** and a **run test method**.

**Docs:** [Creating a test case](docs/creating-a-test-case.md).

Test suites
-----------

[](#test-suites)

Tests suites are defined by the `TestSuite` class which is created with a description and an array of `TestCase` classes.

```
$unit_tests = new TestSuite("Unit tests", [new UserUnitTest, AddressUnitTest]);
```

**Docs:** [Test Suites](docs/test-suite.md).

Running tests
-------------

[](#running-tests)

The library comes with a native test runner that is run from the command line interface, and outputs a summary of the test.

Which tests to run is defined in the file `test.php` in the root composer directory. The file is expected to return an array of test suites.

```
# test.php
$unit_tests = new TestSuite("Unit tests", [new UserUnitTest, new AddressUnitTest]);

return [$unit_tests];
```

```
$composer-root/~ bin/tester

---------------------------------------------------------------------------
 - Unit tests - cases: 2
 --- Unit test of User ✔
 --- Unit test of Address ✔
---------------------------------------------------------------------------
success: 2, failure: 0, assertions: 8, time: 0.04s
---------------------------------------------------------------------------

```

For a comprehensive description of the options available for the native test runner script:

**Docs:** [How to run tests](docs/how-to-run-tests.md).

Inspiration
-----------

[](#inspiration)

This library is inspired by the testing library [mindplay-dk/testies](https://github.com/mindplay-dk/testies).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

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 ~20 days

Total

6

Last Release

3045d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ec1a54f85a6e46909df4ca4852ada0cc4b1482f7208dfc487d05554087e09cc9?d=identicon)[thomasnordahl-dk](/maintainers/thomasnordahl-dk)

---

Top Contributors

[![thomasnordahl-dk](https://avatars.githubusercontent.com/u/5709900?v=4)](https://github.com/thomasnordahl-dk "thomasnordahl-dk (68 commits)")

### Embed Badge

![Health badge](/badges/thomasnordahldk-tester/health.svg)

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

###  Alternatives

[phpunit/phpunit

The PHP Unit Testing framework.

20.0k910.7M134.7k](/packages/phpunit-phpunit)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[codeception/codeception

All-in-one PHP Testing Framework

4.9k86.2M2.9k](/packages/codeception-codeception)[phpunit/phpcov

CLI frontend for php-code-coverage

23621.1M582](/packages/phpunit-phpcov)[facile-it/paraunit

paraunit

146721.6k11](/packages/facile-it-paraunit)[matthiasnoback/live-code-coverage

Generate code coverage reports on a live server

1191.1M2](/packages/matthiasnoback-live-code-coverage)

PHPackages © 2026

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