PHPackages                             stoufa06/generate-tests - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. stoufa06/generate-tests

ActiveProject[Testing &amp; Quality](/categories/testing)

stoufa06/generate-tests
=======================

A script to generate tests for projects

1.0(1y ago)126MITPHPPHP ^8.2

Since Nov 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/stoufa06/generate-tests)[ Packagist](https://packagist.org/packages/stoufa06/generate-tests)[ RSS](/packages/stoufa06-generate-tests/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

GenerateTests
=============

[](#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
------------

[](#installation)

To install the package, you’ll need [Composer](https://getcomposer.org/). Run the following command in your terminal:

```
composer require stoufa06/generate-tests --dev
```

Usage
-----

[](#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

[](#command-line-options)

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

- `--src=`: 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=`: 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=`: Specify a file containing a list of test files that should always be regenerated. Default is `backup_list.txt`.
- `--exclude=`: Specify a file listing folders to exclude from test generation. Default is `excluded_folders.txt`.
- `--marker=`: 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=`: 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

[](#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
------------

[](#contributing)

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

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

550d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dc71504a4c9df30220a909080517e48dc1e4d10745e9c8d28ede075506445b90?d=identicon)[stoufa06](/maintainers/stoufa06)

---

Top Contributors

[![stoufa06](https://avatars.githubusercontent.com/u/3877384?v=4)](https://github.com/stoufa06 "stoufa06 (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stoufa06-generate-tests/health.svg)

```
[![Health](https://phpackages.com/badges/stoufa06-generate-tests/health.svg)](https://phpackages.com/packages/stoufa06-generate-tests)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M680](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M571](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.0k](/packages/orchestra-testbench)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
