2017 © Pedro Peláez
 

symfony-bundle functional-test-generator

Generate skeleton functional test for symfony2 bundle

image

huitiemesens/functional-test-generator

Generate skeleton functional test for symfony2 bundle

  • Friday, January 22, 2016
  • by huitiemesens
  • Repository
  • 1 Watchers
  • 1 Stars
  • 80 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

Functional test Generator Bundle

Build Status SensioLabsInsight, (*1)

Lead Developer : @huitiemesens, (*2)

function-generate-bundle allows you to easily generate skeleton for your functional tests., (*3)

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, (*4)

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., (*5)

Installation


1) Download via composer the bundle, (*6)

   composer require huitiemesens/functionalTestGeneratorBundle

2) Add the bundle to your AppKernel.php under your dev/test environnement, (*7)

   new huitiemesens\FunctionalTestGeneratorBundle\FunctionalTestGeneratorBundle(),

3) call the command from your console. Example to generate all tests for controller inside your blogBundle :, (*8)

   php app/console tests:generate acme:BlogBundle

4) Confirm for each controller inside BlogBundle to generate tests. 5) 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. 6) An authentication credentials is expected: Put unit_test_password and unit_test_email values in your parameters.yml to allow authentication to your tests., (*9)

License

This bundle is available under the MIT license., (*10)

The Versions