PHPackages                             friendsofhyperf/co-phpunit - 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. friendsofhyperf/co-phpunit

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

friendsofhyperf/co-phpunit
==========================

The Co-PHPUnit component for Hyperf.

v3.2.1(3w ago)0414MITPHP

Since Oct 27Pushed 3w agoCompare

[ Source](https://github.com/friendsofhyperf/co-phpunit)[ Packagist](https://packagist.org/packages/friendsofhyperf/co-phpunit)[ Fund](https://hdj.me/sponsors/)[ GitHub Sponsors](https://github.com/huangdijia)[ RSS](/packages/friendsofhyperf-co-phpunit/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (4)Versions (14)Used By (0)

Co-PHPUnit
==========

[](#co-phpunit)

[中文说明](README_CN.md)

Co-PHPUnit runs PHPUnit tests inside a Swoole coroutine. It is useful for tests that exercise coroutine-aware Hyperf components.

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

[](#installation)

Install the package as a development dependency:

```
composer require friendsofhyperf/co-phpunit --dev
```

The package requires `hyperf/coordinator` `~3.2.0` and supports PHPUnit 10, 11, and 12. It does not declare the Swoole extension as a Composer dependency. Without the extension, tests fall back to PHPUnit's normal execution.

Usage
-----

[](#usage)

### Run Tests in Coroutines

[](#run-tests-in-coroutines)

Use `RunTestsInCoroutine` on a test class or on a shared base test class:

```
