PHPackages                             maplephp/unitary - 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. maplephp/unitary

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

maplephp/unitary
================

PHP Unitary is a user-friendly and robust unit testing library designed to make writing and running tests for your PHP code easy.

v2.2.0(2mo ago)5158[1 PRs](https://github.com/MaplePHP/Unitary/pulls)9Apache-2.0PHPPHP &gt;=8.0CI passing

Since Jun 1Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/MaplePHP/Unitary)[ Packagist](https://packagist.org/packages/maplephp/unitary)[ Docs](https://wazabii.se)[ RSS](/packages/maplephp-unitary/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (18)Versions (25)Used By (9)

Unitary – Evidence-Driven PHP Testing Framework
===============================================

[](#unitary--evidence-driven-php-testing-framework)

Unitary is a modern PHP testing framework for developers who value speed, precision, and full control. No configuration. No clutter. Just a clean, purpose-built core that can execute 100,000+ tests per second and scales smoothly from quick sanity checks to full integration suites.

Mocking, validation, and assertions are built in from the start, with no plugins, adapters, or bootstrapping required. The CLI is fast and intuitive, the workflow is consistent, and getting started takes seconds. Whether you are validating a single function or an entire system, Unitary lets you move quickly and test with confidence.

[![Prompt demo](https://camo.githubusercontent.com/3415fd56ac0f8c44b24258fbaa953fd2dd581d669488cb862634eb205b699053/687474703a2f2f77617a616269692e73652f6769746875622d6173736574732f756e69746172792f756e69746172792d636c692d7374617465732e706e67)](https://camo.githubusercontent.com/3415fd56ac0f8c44b24258fbaa953fd2dd581d669488cb862634eb205b699053/687474703a2f2f77617a616269692e73652f6769746875622d6173736574732f756e69746172792f756e69746172792d636c692d7374617465732e706e67)

---

Documentation
-------------

[](#documentation)

Visit the full documentation at:
👉

---

Familiar Syntax. Fast Feedback.
-------------------------------

[](#familiar-syntax-fast-feedback)

Unitary is designed to feel natural for developers. With clear syntax, built-in validation, and zero setup required, writing tests becomes a smooth part of your daily flow and not a separate chore.

```
use MaplePHP\Unitary\TestCase;

group("Your grouped test subject", function (TestCase $case) {

    $json = '{"response":{"status":200,"message":"ok"}}';

    $case->expect($json)
         ->isJson()
         ->hasJsonValueAt("response.status", 200)
         ->validate();
});
```

---

Next-Gen PHP Testing Framework
------------------------------

[](#next-gen-php-testing-framework)

Unitary is a lightning-fast, developer-first testing framework for PHP, built from the ground up with zero third-party dependencies and a highly optimized core, not just a wrapper around legacy tools.

> 🚀 *Test 100,000+ cases in ~1 second. No config. No bloat. Just results.*

---

🔧 Why Use Unitary?
------------------

[](#-why-use-unitary)

- **Works out of the box** – No setup, no config files.
- **Not built on PHPUnit** – Unitary is a standalone framework.
- **100% agnostic** – Every sub-library is purpose-built for speed and control.
- **First-class CLI** – Intuitive test runner that works across platforms.
- **Powerful validation** – Built-in expectation engine, assert support, and structured output.
- **Mocking included** – No external mocking libraries needed.
- **Super low memory usage** – Ideal for local runs and parallel CI jobs.

---

⚡ Lightning-fast Performance
----------------------------

[](#-lightning-fast-performance)

Unitary runs large test suites in a fraction of the time — even **100,000+** tests in just **1 second**.

🚀 That’s up to 50× faster than the most widely used testing frameworks.

---

Getting Started (Under 1 Minute)
--------------------------------

[](#getting-started-under-1-minute)

Set up your first test in three easy steps:

### 1. Install

[](#1-install)

```
composer require --dev maplephp/unitary
```

*You can run unitary globally if preferred with `composer global require maplephp/unitary`.*

---

### 2. Create a Test File

[](#2-create-a-test-file)

Create a file like `tests/unitary-request.php`. Unitary automatically scans all files prefixed with `unitary-` (excluding `vendor/`).

Paste this test boilerplate to get started:

```
use MaplePHP\Unitary\{TestCase};

group("HTTP Request", function(TestCase $case) {

    $request = new Request("GET", "https://example.com/?id=1&slug=hello");

    $case->expect($request->getUri()->getQuery())
        ->hasQueryParam("id", 1)
        ->hasQueryParam("slug", "hello")
        ->validate();
});
```

> 💡 Tip: Run `php vendor/bin/unitary --template` to auto-generate this boilerplate code.

---

### 3. Run Tests

[](#3-run-tests)

```
php vendor/bin/unitary
```

#### Need help?

[](#need-help)

```
php vendor/bin/unitary --help
```

#### The Output:

[](#the-output)

[![Prompt demo](https://camo.githubusercontent.com/5bc6c6370f14e551a06d94f1f2350c59b29252cf86c3019e544f322557011522/687474703a2f2f77617a616269692e73652f6769746875622d6173736574732f756e69746172792f756e69746172792d636c692d73746174652d706173732e706e67)](https://camo.githubusercontent.com/5bc6c6370f14e551a06d94f1f2350c59b29252cf86c3019e544f322557011522/687474703a2f2f77617a616269692e73652f6769746875622d6173736574732f756e69746172792f756e69746172792d636c692d73746174652d706173732e706e67)*And that is it! Your tests have been successfully executed!*

With that, you are ready to create your own tests!

---

📅 Latest Release
----------------

[](#-latest-release)

**v2.0.0**This release marks Unitary’s transition from a testing utility to a full framework. With the core in place, expect rapid improvements in upcoming versions.

---

🧱 Built From the Ground Up
--------------------------

[](#-built-from-the-ground-up)

Unitary stands on a solid foundation of years of groundwork. Before Unitary was possible, these independent components were developed:

- [`maplephp/Emitron`](https://github.com/maplephp/emitron) – PSR-15 kernel and middleware engine
- [`maplephp/http`](https://github.com/maplephp/http) – PSR-7 HTTP messaging and stream handling
- [`maplephp/prompts`](https://github.com/maplephp/prompts) – Interactive prompt/command engine
- [`maplephp/blunder`](https://github.com/maplephp/blunder) – A pretty error handling framework
- [`maplephp/validate`](https://github.com/maplephp/validate) – Type-safe input validation
- [`maplephp/dto`](https://github.com/maplephp/dto) – Strong data transport
- [`maplephp/container`](https://github.com/maplephp/container) – PSR-11 Container, container and DI system
- [`maplephp/cache`](https://github.com/maplephp/cache) – PSR-6 and PSR-16 caching library

This full control means everything works together, no patching, no adapters and no guesswork.

---

Philosophy
----------

[](#philosophy)

> **Test everything. All the time. Without friction.**

TDD becomes natural when your test suite runs in under a second, even with 100,000 cases. No more cherry-picking. No more skipping.

---

Like The CLI Theme?
-------------------

[](#like-the-cli-theme)

That’s DarkBark. Dark, quiet, confident, like a rainy-night synthwave playlist for your CLI.

[Download it here](https://github.com/MaplePHP/DarkBark)

---

🤝 Contribute
------------

[](#-contribute)

Unitary is still young — your bug reports, feedback, and suggestions are hugely appreciated.

If you like what you see, consider:

- Reporting issues
- Sharing feedback
- Submitting PRs
- Starring the repo ⭐

---

📬 Stay in Touch
---------------

[](#-stay-in-touch)

Follow the full suite of MaplePHP tools:

-

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance88

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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 ~34 days

Recently: every ~14 days

Total

20

Last Release

69d ago

Major Versions

v1.1.4 → v2.0.02026-01-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/724b188e785081275926c5b9c07082e2b3f4afb797efdda61eb1630457e17824?d=identicon)[wazabii](/maintainers/wazabii)

---

Top Contributors

[![wazabii8](https://avatars.githubusercontent.com/u/6400238?v=4)](https://github.com/wazabii8 "wazabii8 (142 commits)")[![danielRConsid](https://avatars.githubusercontent.com/u/169045496?v=4)](https://github.com/danielRConsid "danielRConsid (37 commits)")[![CreativeWaDev](https://avatars.githubusercontent.com/u/153771800?v=4)](https://github.com/CreativeWaDev "CreativeWaDev (20 commits)")

---

Tags

ci-cdcode-qualitycontinuous-integrationphpphp-testingtddtesting-librarytesting-toolsunit-testingunit-testsuser-friendlyvalidationphptestingclicommand-linetest

### Embed Badge

![Health badge](/badges/maplephp-unitary/health.svg)

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

###  Alternatives

[phan/phan

A static analyzer for PHP

5.6k11.2M1.1k](/packages/phan-phan)[zoon/puphpeteer

A Puppeteer bridge for PHP, supporting the entire API.

204192.9k1](/packages/zoon-puphpeteer)[quizlet/hammock

Hammock is a stand-alone mocking library for Hacklang.

27445.5k](/packages/quizlet-hammock)[playwright-php/playwright

Modern PHP library for Playwright automation: browsing, scraping, screenshots, testing, and more.

7613.0k5](/packages/playwright-php-playwright)

PHPackages © 2026

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