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

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

bypikod/php-test
================

Very simple testing library with PHP

1.0.1(2y ago)0201MITPHP

Since Nov 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ByPikod/php-test)[ Packagist](https://packagist.org/packages/bypikod/php-test)[ Docs](https://github.com/ByPikod/php-test#readme)[ RSS](/packages/bypikod-php-test/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (1)

PHP Test
========

[](#php-test)

[![License](https://camo.githubusercontent.com/007adb6e1ee720013731b03fed9c7b0c01f50b6cd5acfa5c3272f50af62e93d2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f427950696b6f642f7068702d746573742e7376673f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/007adb6e1ee720013731b03fed9c7b0c01f50b6cd5acfa5c3272f50af62e93d2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f427950696b6f642f7068702d746573742e7376673f7374796c653d666f722d7468652d6261646765)[![Maintaned](https://camo.githubusercontent.com/8673e90d546a2c5ead6be528f7f7978f877d3f64205f10b19ad02e2d0d6726d0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61696e7461696e65642533462d7965732d677265656e2e7376673f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/8673e90d546a2c5ead6be528f7f7978f877d3f64205f10b19ad02e2d0d6726d0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61696e7461696e65642533462d7965732d677265656e2e7376673f7374796c653d666f722d7468652d6261646765)[![Commits](https://camo.githubusercontent.com/eabf3ce123fed9ba14a745f549bd69f127f12237e4810a204f94dbbab0871c32/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6d6d6974732d73696e63652f427950696b6f642f7068702d746573742f6c61746573742e7376673f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/eabf3ce123fed9ba14a745f549bd69f127f12237e4810a204f94dbbab0871c32/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6d6d6974732d73696e63652f427950696b6f642f7068702d746573742f6c61746573742e7376673f7374796c653d666f722d7468652d6261646765)[![Forks](https://camo.githubusercontent.com/3c1d5f76a095db48c962af42f176f6c47764fe3dd71271129eca7d6c3e424612/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f427950696b6f642f7068702d746573742e7376673f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/3c1d5f76a095db48c962af42f176f6c47764fe3dd71271129eca7d6c3e424612/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f427950696b6f642f7068702d746573742e7376673f7374796c653d666f722d7468652d6261646765)[![Stars](https://camo.githubusercontent.com/2bec0c76f0dca0ba14e71f62be52c0b94808d58f7c721f63f0493dc7583c6d64/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f427950696b6f642f7068702d746573742e7376673f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/2bec0c76f0dca0ba14e71f62be52c0b94808d58f7c721f63f0493dc7583c6d64/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f427950696b6f642f7068702d746573742e7376673f7374796c653d666f722d7468652d6261646765)[![Watchers](https://camo.githubusercontent.com/44887ddbd797670864a948849b197c7021f5669549e73d11d0e10ceb48557a82/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f77617463686572732f427950696b6f642f7068702d746573742e7376673f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/44887ddbd797670864a948849b197c7021f5669549e73d11d0e10ceb48557a82/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f77617463686572732f427950696b6f642f7068702d746573742e7376673f7374796c653d666f722d7468652d6261646765)

Simple PHP test library for unit testing.

Warning

Minimum PHP version for this package is PHP7.

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

[](#installation)

Add this package to your project with composer:

```
composer require bypikod/php-test
```

Getting Started
---------------

[](#getting-started)

Basic Test:

```
use PHPTest\Test;

Test::it("test", function (Test $test) {
    $test->assertEqual(1, 2);
});
```

Suite Test:

```
use PHPTest\Test;

Test::suite("test", function ($it) {
    $it("test", function (Test $test) {
        $test->assertEqual(1, 1);
    });
    $it("test", function (Test $test) {
        $test->assertEqual(1, 2);
    });
});
```

Suite Test with Class:

```
use PHPTest\Test;

class RouterTest extends Router
{
    /**
     * Test get branch
     * @test Branch Getter Test
     * @since 1.0.0
     */
    public function getBranchTest(Test $test): void
    {
        // Test get branch
        $this->getBranch('/a/b', false)[] = 'test';
        $test->assertArrayContains($this->getBranch('/a/b', false), 'test');
        // Test by popping the last element
        $this->getBranch('/a/b/test', true)[] = 'test';
        $test->assertArrayContains($this->getBranch('/a/b', false), 'test');
    }
}

$router = new RouterTest();
Test::suiteClass($router);
```

Contribute
----------

[](#contribute)

Contributers are welcome! Just make sure you understand the follow the rules below:

- Contributions must follow the [PSR-2](https://www.php-fig.org/psr/psr-2/) coding standard.
- Make sure you're writing documentation that covers your code changes.
- Follow the [Code of Conduct](CODE_OF_CONDUCT.md).

And you should know your submissions will be under [MIT License](LICENSE).

License
-------

[](#license)

This project is licensed under the terms of the MIT License.

You are free to use this project in compliance with the MIT License. If you decide to use, modify, or redistribute this software, you must include a copy of the original license and copyright notice in all copies or substantial portions of the software.

For more information about the MIT License, visit: [MIT License](https://www.mit.edu/~amini/LICENSE.md).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

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

Total

2

Last Release

919d ago

### Community

Maintainers

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

---

Top Contributors

[![ByPikod](https://avatars.githubusercontent.com/u/46069238?v=4)](https://github.com/ByPikod "ByPikod (9 commits)")

---

Tags

mockingphpphp-testsuitetesttestingunit-testphpunittestsuite

### Embed Badge

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

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

###  Alternatives

[letsdrink/ouzo-goodies

Utility classes, test assertions and mocking framework extracted from Ouzo framework.

132617.9k7](/packages/letsdrink-ouzo-goodies)[php-vfs/php-vfs

Virtual file system implementation for use with PHP unit testing.

572.7M24](/packages/php-vfs-php-vfs)[colinodell/psr-testlogger

PSR-3 compliant test logger based on psr/log v1's, but compatible with v2 and v3 too!

1712.1M47](/packages/colinodell-psr-testlogger)[quizlet/hammock

Hammock is a stand-alone mocking library for Hacklang.

27445.5k](/packages/quizlet-hammock)[hot/phpunit-runner

The lib allows to watch phpunit tests

3066.9k4](/packages/hot-phpunit-runner)[frozzare/wp-test-suite

Run WordPress test easy

2225.5k21](/packages/frozzare-wp-test-suite)

PHPackages © 2026

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