Skip to content
This repository was archived by the owner on Nov 15, 2025. It is now read-only.

Latest commit

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

pest-plugin-hyperf

Latest Stable VersionTotal DownloadsLicense

This is a Pest plugin that enables your Hyperf project's Pest to run within a Swoole-based coroutine environment.

Installation

composer require friendsofhyperf/pest-plugin-hyperf --dev

Usage

php vendor/bin/pest --coroutine
# or
php vendor/bin/pest --prepend test/prepend.php --coroutine
  • test/prepend.php
<?phprequire_once__DIR__ . '/../vendor/autoload.php';
defined('BASE_PATH') ordefine('BASE_PATH', dirname(__DIR__, 1));
(function () {
\Hyperf\Di\ClassLoader::init();
\Hyperf\Context\ApplicationContext::setContainer(
new \Hyperf\Di\Container((new \Hyperf\Di\Definition\DefinitionSourceFactory())())
);
// $container->get(Hyperf\Contract\ApplicationInterface::class);
})();

Contact

License

MIT

About

The Pest Hyperf Plugin.

Resources

Security policy

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages