I\'m trying to write a functional test for my project in Symfony2. I\'d like to test if a user can access a page, fill up a form and submit it. I\'m trying to find a way to roll
You could use a dedication test database for testing
Another option is using Codeception. This is a unit testing bundle that works with Symfony.
If you use this, you can configure it to use a test database and then "clean it up" after each testing cycle.
An example yaml configuartion to do that would be something like, it is the cleanup: true
that does what you want;
class_name: UnitTester
modules:
enabled:
- Asserts
- Symfony2:
app_path: '../../app'
var_path: '../../app'
environment: 'test'
- Doctrine2:
depends: Symfony2
cleanup: true
- \AppBundle\Helper\Unit