ylsalame/laravelapidoctester

Laravel APIDoc Tester

dev-master 2018-09-14 12:09 UTC

This package is auto-updated.

Last update: 2024-09-16 02:13:09 UTC


README

Artisan 命令,用于使用 APIDoc 注释创建和执行 API 测试

安装

  1. ylsalame/laravelapidoctester 添加到 composer.json
"require": {
	"ylsalame/laravelapidoctester": "~0.1"
}
  1. 从 CLI 更新 Composer
composer update

使用方法(Artisan)

php artisan apidoctester

APIDoc Tester 脚本工具,具有可视化界面。这意味着在您可视化确认并认可将要执行的操作之前,不会执行任何操作。以下是界面示例

命令选项/标志

api_dir

[optional] The directory where API classes/methods are kept (recursively scanned)
[default] /app/Http/Controlers
If no files with APIDoc blocks are found, the script will raise an exception

output_dir

[optional] The directory where APIDoc/Codeception files will be stored
[default] /storage/app/testing/apidoc
APIDoc and Codeception generates multiple files and this arg will define where these will be stored

keep_files

[optional] This stops the script from deleting all APIDoc/Codeception files it has generated, including the api_data.json file.
[default] false

输出

视觉反馈

测试将通过生成的 APIDoc .json 文件运行,并在执行过程中显示在屏幕上

APIDocs 文件

默认情况下,此脚本将删除它创建的所有内容,包括 APIDocs/Codeception 文件,除非将 "keep_files" 参数设置为 true