Download the PHP package tourze/phpunit-workerman without Composer

On this page you can find all versions of the php package tourze/phpunit-workerman. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpunit-workerman

Workerman PHPUnit Testing Framework

中文

Latest Version Total Downloads

专为 Workerman 应用设计的 PHPUnit 测试框架,解决异步、事件驱动应用的测试难题。

目录

核心特性

主要功能

解决的问题

安装

系统要求

依赖项

安装命令

快速开始

基础 Worker 测试

定时器测试

连接测试

核心 API

测试基类

WorkermanTestCase

用于一般的 Workerman 应用测试,提供 Worker 管理和连接模拟。

AsyncTestCase

专门用于异步操作测试

模拟组件

MockEventLoop

模拟事件循环

Trait 组件

TimeControl

时间控制相关功能

AsyncAssertions

异步操作断言

ConnectionMocking

连接模拟功能

高级用法

复杂异步流程测试

协议测试

高并发连接测试

错误处理测试

最佳实践

1. 测试初始化

正确设置和清理测试环境

2. 异步操作超时

为异步操作设置合理的超时时间

3. 时间控制

使用时间快进而不是真实等待

4. 连接清理

及时清理连接和资源

常见问题

调试相关

Q: 定时器测试失败怎么办? A: 使用 fastForward() 方法而不是真实等待

Q: 连接状态异常? A: 确保使用 mockConnectionClose() 等方法正确管理连接生命周期

Q: 测试运行超时? A: 检查异步操作是否正确完成,确保没有无限循环

Q: 测试环境初始化失败? A: 确保测试类正确继承并调用 parent::setUp() 和 parent::tearDown()

性能优化

如果测试较慢,可以尝试:

贡献指南

欢迎提交 Issue 和 Pull Request 来改进这个测试框架。

开发环境

代码规范

遵循 PSR-12 编码标准

许可证

MIT 许可证

相关资源


这个测试框架让您能够轻松测试 Workerman 应用中的异步操作、事件处理和网络通信功能。


All versions of phpunit-workerman with dependencies

PHP Build Version
Package Version
Requires ext-sockets Version *
symfony/dependency-injection Version ^7.3
symfony/framework-bundle Version ^7.3
symfony/yaml Version ^7.3
workerman/workerman Version ^5.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tourze/phpunit-workerman contains the following files

Loading the files please wait ...