PHPackages                             osflab/test - 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. osflab/test

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

osflab/test
===========

OSF simple unit test component

3.0.0(8y ago)03418AGPL-3.0-or-laterPHPPHP ^7.1.0

Since Feb 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/osflab/test)[ Packagist](https://packagist.org/packages/osflab/test)[ Docs](https://github.com/osflab/test)[ RSS](/packages/osflab-test/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (3)Used By (18)

A very simple unit-test component
=================================

[](#a-very-simple-unit-test-component)

A very quick learning time unit test component, that uses the command line to run the tests. Although it is under development, this component works.

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

[](#installation)

You need at least php 7.1 and `composer` to use this component:

```
sudo apt install composer
```

### From github

[](#from-github)

Installation:

```
git clone git@github.com:osflab/test.git
cd test && composer install
```

### Use osflab/test in your app with composer

[](#use-osflabtest-in-your-app-with-composer)

To use it in your project, just add `osflab/test` in your composer.json file.

Usage
-----

[](#usage)

To run your tests, use the command line:

```
bin/runtests [directory] [filter]
```

The test runner find recursively the `Test.php` files in `[directory]` (default is current) and run it. The second parameter `[filter]` can be used to run only certain tests.

Simple example:

```
bin/runtests
```

Output:

```
- \Osf\Test\Test ...................................................... [  OK  ]
- 1 test file(s), 2 tests passed, success ^^

```

When this component is installed as a dependency of your project, the `runtests`binary is available in `vendor/bin` directory.

Example in the `Application` component project:

```
vendor/bin/runtests . Acl
```

Output:

```
- \Osf\Application\Acl\Test ........................................... [  OK  ]
- \Osf\Application\Config\Test ........................................ [ SKIP ]
- 1 test file(s), 51 tests passed, success ^^

```

Writing Test.php files
----------------------

[](#writing-testphp-files)

The `Test.php` file content look like this:

```
use Osf\Test\Runner as OsfTest;

class Test extends OsfTest
{
    public static function run()
    {
        self::reset();

        // Your test here
        try {
            self::assert(/* condition */, /* [message if fails] */);
            self::assertEqual(/* calculated */, /* expected */, /* [message if fails] */);
            // ...
        }

        // Displays an exception
        catch (\Exception $e) {
            self::assertFalseException($e);
        }

        return self::getResult();
    }
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

2945d ago

PHP version history (2 changes)3.0.0PHP ^7.1.0

3.0.x-devPHP ^7.1.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/abc3dea1dc84c5b66d10072481ff94a25c852239e3597fde32e86204b636f911?d=identicon)[Guillaume Ponçon](/maintainers/Guillaume%20Pon%C3%A7on)

---

Top Contributors

[![gponcon](https://avatars.githubusercontent.com/u/1412541?v=4)](https://github.com/gponcon "gponcon (22 commits)")

### Embed Badge

![Health badge](/badges/osflab-test/health.svg)

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

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

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

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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