定制 phpexperts/php-test-server 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

phpexperts/php-test-server

最新稳定版本:v1.0.0

Composer 安装命令:

composer require phpexperts/php-test-server

包简介

A quick and easy standard PHP HTTP REST API Test Server.

README 文档

README

PHP API Test Server is a PHP Experts, Inc., Project meant to ease the testing of HTTP clients and REST clients.

It is more or less an echo server. It supports all major HTTP verbs:

GET, POST, PUT, PATCH, and DELETE

Installation

Via Composer

composer require --dev phpexperts/php-test-server

Usage

The default port the server listens to is 127.0.0.5:49519.

To run standalone:

bin/php-test-server [PORT]

To run in a PHP script:

TestApiRestServer::runForked(45192);
TestApiRestServer::shutdown();

To run as part of PHPUnit:

class MyApiTest extends TestApiServerTestCase
{
}

Use cases

Api Rest Server Binary (PHPExperts\PHPTestServer\Tests\ApiRestServerBinary)
✔ Can launch the standalone test server
✔ It is an HTTP server
✔ Can shut down the test server

Api Rest Server (PHPExperts\PHPTestServer\Tests\ApiRestServer)
✔ Can launch the test server
✔ It is an HTTP server
✔ It supports the GET, POST, PUT, PATCH, and DELETE HTTP verbs
✔ Can shut down the HTTP server

Api Server Test Case (PHPExperts\PHPTestServer\Tests\ApiServerTestCase)
✔ Accepts GET requests
✔ Accepts POST requests
✔ Accepts PUT requests
✔ Accepts PATCH requests
✔ Accepts DELETE requests

Testing

phpunit --testdox

License

This project is licensed under the Creative Commons Attribution License v4.0 International.

CC.by License Summary

About The Author

Theodore R. Smith theodore@phpexperts.pro
GPG Fingerprint: 4BF8 2613 1C34 87AC D28F 2AD8 EB24 A91D D612 5690
CEO: PHP Experts, Inc.

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: CC-BY-4.0
  • 更新时间: 2024-09-15