https://github.com/boldare/xsolve-unit-skelgen-bundle
Symfony2 Bundle for PHPUnit Skelgen Integration
https://github.com/boldare/xsolve-unit-skelgen-bundle
Last synced: about 1 year ago
JSON representation
Symfony2 Bundle for PHPUnit Skelgen Integration
- Host: GitHub
- URL: https://github.com/boldare/xsolve-unit-skelgen-bundle
- Owner: boldare
- Created: 2013-07-15T12:12:21.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2023-02-06T10:11:02.000Z (over 3 years ago)
- Last Synced: 2025-03-29T13:51:19.883Z (about 1 year ago)
- Language: PHP
- Homepage: http://xsolve.pl/opensource
- Size: 273 KB
- Stars: 8
- Watchers: 70
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About
[](http://knpbundles.com/xsolve-pl/xsolve-unit-skelgen-bundle)
[](https://travis-ci.org/xsolve-pl/xsolve-unit-skelgen-bundle)
[](https://insight.sensiolabs.com/projects/033dad83-796b-48c2-ba32-6b48a4e8f4c3)
This bundle helps with PHPUnit test suites creation by using phpunit-skelgen (Skeleton Generator)
Features:
* creates test suite class respectively to given namespace (for instance
Controller/DemoController.php will have test in Test/Controller/DemoControllerTest.php)
* asterisks and dots pattern matching - it will create test suites for every matching class in found directory
* fully TDD capable - creates production classes based on test suite class
* easy to extend and introduce changes in the future

# Installation
1) Add to composer.json
"require": {
"xsolve-pl/xsolve-unit-skelgen-bundle": "1.0.*"
}
2) Install dependencies
composer install
3) Enable the bundle in app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new Xsolve\UnitSkelgenBundle\XsolveUnitSkelgenBundle(),
);
}
# Usage
Generate PHPUnit test class for a single production class:
app/console xsolve:skelgen:test Xsolve/ExampleBundle/Controller/DefaultController
Generate PHPUnit test class for a namespace:
app/console xsolve:skelgen:test Xsolve/ExampleBundle/Controller/.
Nice matching! It will create tests for DefaultControllers in all the bundles:
app/console xsolve:skelgen:test Xsolve/*/Controller/DefaultController
Using the same patterns you can generate production classes from test classes:
app/console xsolve:skelgen:class Xsolve/ExampleBundle/Tests/Controller/DefaultControllerTest