friendsofhyperf / pest-plugin-hyperf
This package is abandoned and no longer maintained.
No replacement package was suggested.
The Pest Hyperf Plugin.
Package info
github.com/friendsofhyperf/pest-plugin-hyperf
pkg:composer/friendsofhyperf/pest-plugin-hyperf
v3.2.0-alpha.1
2025-02-05 14:17 UTC
Requires
- php: ^8.1
- ext-swoole: *
- hyperf/coordinator: ~3.2.0
- hyperf/di: ~3.2.0
- hyperf/support: ~3.2.0
- pestphp/pest: ^2.8.0
- pestphp/pest-plugin: ^2.0.1
This package is auto-updated.
Last update: 2025-12-02 02:13:55 UTC
README
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
<?php require_once __DIR__ . '/../vendor/autoload.php'; defined('BASE_PATH') or define('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); })();