Search code examples
phpsymfonydoctrine-ormphpunitfunctional-testing

Symfony + Doctrine functional database testing


I found only a few lines about database functional testing in the documentation: http://symfony.com/doc/current/cookbook/testing/database.html

The problem is:

  1. I need to install database schema from dev database to test database before testing.
  2. I need to reinstall fixtures before each test.

It's not described in the documentation. How can I do it using symfony?


Solution

  • I use this command to do same job :

    In console line :

    doctrine:database:create --env=test
    
    doctrine:schema:create --env=test
    
    doctrine:fixture:load --env=test