PHPackages                             elfstack/unit-test-lite - 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. elfstack/unit-test-lite

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

elfstack/unit-test-lite
=======================

A light unit test class providing basic test function and beautiful report.

v0.1.3(9y ago)021MITPHP

Since Aug 25Pushed 9y ago1 watchersCompare

[ Source](https://github.com/elfstack/unit-test-lite)[ Packagist](https://packagist.org/packages/elfstack/unit-test-lite)[ Docs](https://github.com/elfstack/unit-test-lite)[ RSS](/packages/elfstack-unit-test-lite/feed)WikiDiscussions master Synced 4w ago

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

Unit
====

[](#unit)

ElfStack\\Unit is a easy-to-use unit test class, not providing much function but light and easy.

Quick overview
--------------

[](#quick-overview)

Let's see a code example:

```
use ElfStack\Unit;

$unit = new Unit();

$unit->start('Unit test group name(can be null)');

$str = 'Hello World!';
$unit->describe('First way to use', 'Here comes more info')->expect($str)->toBe('Hello World');

$unit->describe('Simple compare', 'You can also use not to be')->expect($str)->notToBe(null);

$unit->assertEqual('You can also use this way to run a test', $str, 'Hello World!', 'More info comes here now');

$unit->assertUnequal('Unequal method', $str, null);

$unit->assert('You can use user defined functions too.', function () use ($str) {
	echo 'Output in function will shows too.';
	return $str == true;
}, 'Any function call be recognized by `is_callable` can be called.The function\'s output and return value are displayed as `Expected` and `Got`.');

$unit->printResult();

$unit->start();
$var = 1 + 1;
$unit->assertEqual('You can use `start` method to start another group of unit test.', $var, 2,
						 'You can print result in one page too.You can use `result` method to get result without output it.');
echo $unit->result();

```

And you will got(show as 67%):

[![Unit Test Report](https://github.com/Tamce/outter-img/raw/master/UnitTestReport.png)](https://github.com/Tamce/outter-img/raw/master/UnitTestReport.png)

Usage
-----

[](#usage)

```
composer require elfstack/unit-test-light

```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

3597d ago

### Community

Maintainers

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

---

Top Contributors

[![Tamce](https://avatars.githubusercontent.com/u/12567959?v=4)](https://github.com/Tamce "Tamce (6 commits)")

---

Tags

unittesttestsunit test

### Embed Badge

![Health badge](/badges/elfstack-unit-test-lite/health.svg)

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

###  Alternatives

[dvdoug/behat-code-coverage

Generate Code Coverage reports for Behat tests

623.9M51](/packages/dvdoug-behat-code-coverage)[colinodell/psr-testlogger

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

1813.8M75](/packages/colinodell-psr-testlogger)[diablomedia/phpunit-pretty-printer

A PHPUnit result printer that shows per-file test progress and execution times

80536.3k5](/packages/diablomedia-phpunit-pretty-printer)[icecave/isolator

Dependency injection for global functions.

351.4M29](/packages/icecave-isolator)[friends-of-phpspec/phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

212.7M130](/packages/friends-of-phpspec-phpspec-code-coverage)[leanphp/behat-code-coverage

Generate Code Coverage reports for Behat tests

51361.4k2](/packages/leanphp-behat-code-coverage)

PHPackages © 2026

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