testomatio/list-tests

PHPUnit & Codeception 测试的测试预览和导入

0.2.4 2024-08-27 20:54 UTC

This package is auto-updated.

Last update: 2024-08-27 20:56:16 UTC


README

CI

目前支持的测试列表支持 PHP 8+,对于 PHP 7,请查看 0.1.x 分支

此 CLI 工具会打印 PHP 项目中的所有测试(不执行它们)。轻松检查测试数量并获取测试的实时文档(Markdown 格式)!

支持 PHPUnit & Codeception。

此 CLI 脚本也可用于将测试导入 Testomat.io 应用程序。

安装

composer require testomatio/list-tests --dev

使用方法

要打印所有测试,请执行指向包含测试的目录的 list-tests 脚本

php vendor/bin/list-tests test/

这将打印类似以下内容的输出

要打印测试到文件中,请使用带有 --markdown 选项的命令,提供要保存信息的文件名

php vendor/bin/list-tests tests --markdown test-docs.md

此命令将测试列表保存到 "tests.md" 文件中。

要使用 PREPEND_URL 环境变量显示带有指向 GitHub/GitLab/BitBucket 上对应文件的链接的测试列表,请设置测试文件的基 URL。

PREPEND_URL=https://github.com/testomatio/php-list-tests/tests php vendor/bin/list-tests tests --markdown tests.md 

这将生成一个类似于 test-docs.md 的文件。

导入到 Testomat.io

此脚本还可以将 PHP 项目的测试导入到 testomat.io 项目中。传递您的项目的 TESTOMATIO API 密钥以导入测试

TESTOMATIO={api-key} php vendor/bin/list-tests tests