承接 maplephp/unitary 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

maplephp/unitary

Composer 安装命令:

composer require --dev 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.

README 文档

README

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

Documentation

Visit the full documentation at:
👉 https://maplephp.github.io/unitary/

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

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?

  • 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

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)

Set up your first test in three easy steps:

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

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

php vendor/bin/unitary

Need help?

php vendor/bin/unitary --help

The Output:

Prompt demo And that is it! Your tests have been successfully executed!

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

📅 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

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

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

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?

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

Download it here

🤝 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

Follow the full suite of MaplePHP tools:

maplephp/unitary 适用场景与选型建议

maplephp/unitary 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 169 次下载、GitHub Stars 达 5, 最近一次更新时间为 2024 年 06 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「cli」 「testing」 「test」 「command line」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 maplephp/unitary 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 maplephp/unitary 我们能提供哪些服务?
定制开发 / 二次开发

基于 maplephp/unitary 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 169
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 22
  • 依赖项目数: 8
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2024-06-01