huitiemesens / functional-test-generator
Generate skeleton functional test for symfony2 bundle
Installs: 87
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 3
Type:symfony-bundle
Requires
- php: >=5.3.3
- symfony/browser-kit: ~2.3|~2.9
- symfony/console: ~2.1|~3.0
- symfony/framework-bundle: ~2.3|~2.9
- symfony/symfony: ~2.3|~2.9
Requires (Dev)
- doctrine/doctrine-bundle: ~1.2
- doctrine/orm: ~2.4
- liip/functional-test-bundle: ^1.2
- phpunit/phpunit: 4.4.1
- propel/propel1: 1.6.*
This package is not auto-updated.
Last update: 2024-11-09 20:17:33 UTC
README
Lead Developer : @huitiemesens
function-generate-bundle allows you to easily generate skeleton for your functional tests.
Currently supported :
- Authentification :
- You can add authentication to your tests to get access to secured routes. (Check step 6 below)
- This bundle require "liip/functional-test-bundle" to provide authenticated client
- Fixtures : This bundle require
- You can load fixtures inside your tests (check step 5 below)
- "liip/functional-test-bundle" to provide authenticated client
- Route : Any routes that fits the Bundle:Controller:actionName format
Future releases : (feel free to PR if you want to help)
- Route : default variable for routes
- POST Form : Generate form based on annotations for given route
- More Basic Tests : Currently the skeleton generates tests with isSuccessful() asset only. I'd like to propose more options to get more basic tests.
Installation
-
Download via composer the bundle
composer require huitiemesens/functionalTestGeneratorBundle
-
Add the bundle to your AppKernel.php under your dev/test environnement
new huitiemesens\FunctionalTestGeneratorBundle\FunctionalTestGeneratorBundle(),
-
call the command from your console. Example to generate all tests for controller inside your blogBundle :
php app/console tests:generate acme:BlogBundle
-
Confirm for each controller inside BlogBundle to generate tests.
-
You can add fixtures to your tests. Go to your freshly SetUpFunctionalTest.php ( inside newly created Tests yourBundle ) and go to executesFixtures() function. You can add you declared fixtures inside the getFixtures->() line 192. Array is expected.
-
An authentication credentials is expected: Put unit_test_password and unit_test_email values in your parameters.yml to allow authentication to your tests.
License
This bundle is available under the MIT license.