承接 stoufa06/generate-tests 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

stoufa06/generate-tests

最新稳定版本:1.0

Composer 安装命令:

composer create-project stoufa06/generate-tests

包简介

A script to generate tests for projects

README 文档

README

This package helps automate the creation of PHPUnit test files for your PHP project. It scans specified source directories for PHP files and generates corresponding test classes.

Installation

To install the package, you’ll need Composer. Run the following command in your terminal:

composer require stoufa06/generate-tests --dev

Usage

After installing the package, use the generate-tests script from the command line to generate test files for your source code.

Command Line Options

The script supports several command line options to customize its behavior:

  • --src=<path>: Specify the source directory containing the PHP files for which tests should be generated. Default is src. If a relative path is provided, it will be resolved using the base directory.

  • --tests=<path>: Specify the output directory where the test files will be generated. Default is tests. If a relative path is provided, it will be resolved using the base directory.

  • --backup=<file>: Specify a file containing a list of test files that should always be regenerated. Default is backup_list.txt.

  • --exclude=<file>: Specify a file listing folders to exclude from test generation. Default is excluded_folders.txt.

  • --marker=<bool>: Enable or disable the check for a specific marker in test files. By default, only files containing a '// Generated by script' comment will be regenerated if they already exist.

  • --baseDir=<path>: Specify the base directory to resolve relative paths. Default is the current working directory. If provided, all relative paths for src, tests, backup, and exclude will be based on this directory.

Example Usage

vendor/bin/generate-tests --src=src --tests=tests --backup=backup_list.txt --exclude=excluded_folders.txt --marker=1 --baseDir=/path/to/base

This command will generate test files for all PHP files within the src directory, output them to the tests directory, check against backup_list.txt and excluded_folders.txt for any specific rules, and regenerate any previously scripted files containing the marker.

Contributing

Feel free to submit issues or pull requests. Contributions are welcome!

License

This project is licensed under the MIT License. See the LICENSE file for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-06