Download the PHP package stoufa06/generate-tests without Composer
On this page you can find all versions of the php package stoufa06/generate-tests. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stoufa06/generate-tests
More information about stoufa06/generate-tests
Files in stoufa06/generate-tests
Package generate-tests
Short Description A script to generate tests for projects
License MIT
Informations about the package generate-tests
GenerateTests
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:
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 issrc. 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 istests. 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 isbackup_list.txt. -
--exclude=<file>: Specify a file listing folders to exclude from test generation. Default isexcluded_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 forsrc,tests,backup, andexcludewill be based on this directory.
Example Usage
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.