micro-module / unit-test-generator
POC for unit test generator
Installs: 1 952
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- fakerphp/faker: ^1.23
Requires (Dev)
- mockery/mockery: ^1.2
- php-parallel-lint/php-console-highlighter: ^0.4
- php-parallel-lint/php-parallel-lint: ^1.1
- phpmd/phpmd: ^2.6
- phpstan/phpstan: ^0.11
- phpstan/phpstan-mockery: ^0.11
- phpstan/phpstan-phpunit: ^0.11
- phpunit/phpunit: ^8.0
- roave/security-advisories: dev-master
- symplify/easy-coding-standard: ^5.4
- vimeo/psalm: ^3.0
README
Proof-of-concept component providing unit test generator.
Documentation
This project can generate or single unit for one class or for all project with all needed mocks.
Getting started
-
For example if you want generate unit test for one class use following code:
$testGenerator = new MicroModule\UnitTestGenerator\Service\TestClass();
$testGenerator->generate(FooService::class);
-
For generate tests and mocks for all project use:
$testGenerator = new MicroModule\UnitTestGenerator\Service\TestProject(realpath('src'), ['Migrations', 'Presentation', 'Exception']);
$testGenerator->generate();
second argument is array of excluded folders
License
This project is licensed under the MIT License - see the LICENSE file for details