dev-master
9999999-dev https://github.com/tom-sapletta-com/unittest-generatorGenerating PHP Unittest
MIT
The Requires
- php ^5.3.3 || ^7.0
- phpunit/phpunit 5.5.*
by Tomasz Sapletta
phpunit tests phpunit generator automatically tests
Generating PHP Unittest
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, (*1)
https://tom.sapletta.com/project/a-tool-to-automatically-generate-phpunit-tests/, (*2)
$folder_project = 'src'; $folder_test = 'tests'; $namespace_project = 'Phunc'; $project_author = 'tom-sapletta-com'; $needle = ['interface', 'abstract']; $files = new FilesGenerator($folder_project, $needle);
$result = new UnittestGenerator($files, $folder_test, $namespace_project, $project_author);
php test.php
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
CreateSummaryTest.php FilesGeneratorTest.php TemplateTest.php UnittestGeneratorTest.php
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
configuration data + set path_source for searching php classes + set path_test folder for tests + template for unit test, (*3)
find in path_source php files and get just classes: + no interface + no abstract + no functions, (*4)
generate files for test content in path_test folder show summary, (*5)
Generating PHP Unittest
MIT
phpunit tests phpunit generator automatically tests