PHPackages                             tom-sapletta-com/unittest-generator - 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. tom-sapletta-com/unittest-generator

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

tom-sapletta-com/unittest-generator
===================================

Generating PHP Unittest

017PHP

Since Oct 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/tom-sapletta-com/unittest-generator)[ Packagist](https://packagist.org/packages/tom-sapletta-com/unittest-generator)[ RSS](/packages/tom-sapletta-com-unittest-generator/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP Unit Test Generator
=======================

[](#php-unit-test-generator)

About
-----

[](#about)

With UnittestGenerator is possible create some part of file, but not all, beacue it is what must by defined by user, but i will try find some easy solution in the future, which can help with testing datatype and many methods.

- files
- class name
- one method

Article
-------

[](#article)

Example
-------

[](#example)

### Configuration (in test.php)

[](#configuration-in-testphp)

```
$folder_project = 'src';
$folder_test = 'tests';
$namespace_project = 'Phunc';
$project_author = 'tom-sapletta-com';

$needle = ['interface', 'abstract'];
$files = new FilesGenerator($folder_project, $needle);

```

### Usage

[](#usage)

```
$result = new UnittestGenerator($files, $folder_test, $namespace_project, $project_author);

```

### Start in Console

[](#start-in-console)

```
php test.php

```

### Result in console, Summary

[](#result-in-console-summary)

```
folder_test: tests
namespace_project: Phunc
project_author: tom-sapletta-com
FILE excluded:0
FILE scanned:0
FILE todo:4
FILE existing (not created):0
FILE TESTS created:4

+ tests\CreateSummaryTest.php

+ tests\FilesGeneratorTest.php

+ tests\TemplateTest.php

+ tests\UnittestGeneratorTest.php

```

### Result Tests Files

[](#result-tests-files)

```
CreateSummaryTest.php
FilesGeneratorTest.php
TemplateTest.php
UnittestGeneratorTest.php

```

### Result in console, Summary when test file existing

[](#result-in-console-summary-when-test-file-existing)

```
folder_test: tests
namespace_project: Phunc
project_author: tom-sapletta-com
FILE excluded:0
FILE scanned:0
FILE todo:5
FILE existing (not created):5
FILE TESTS created:0

```

\#How it works

configuration data

- set path\_source for searching php classes
- set path\_test folder for tests
- template for unit test

find in path\_source php files and get just classes:

- no interface
- no abstract
- no functions

generate files for test content in path\_test folder show summary

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5669657?v=4)[Tom Sapletta](/maintainers/tom-sapletta-com)[@tom-sapletta-com](https://github.com/tom-sapletta-com)

---

Top Contributors

[![tom-sapletta-com](https://avatars.githubusercontent.com/u/5669657?v=4)](https://github.com/tom-sapletta-com "tom-sapletta-com (26 commits)")

### Embed Badge

![Health badge](/badges/tom-sapletta-com-unittest-generator/health.svg)

```
[![Health](https://phpackages.com/badges/tom-sapletta-com-unittest-generator/health.svg)](https://phpackages.com/packages/tom-sapletta-com-unittest-generator)
```

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14228.7M341](/packages/dms-phpunit-arraysubset-asserts)[phpbenchmark/phpbenchmark

Easy to use benchmark toolkit for your PHP-application. This library contains classes for comparing algorithms as well as benchmarking application responses

8011.5k2](/packages/phpbenchmark-phpbenchmark)

PHPackages © 2026

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