Symfony - Delete and reload all database records for each test

Posted by Andree on Stack Overflow See other posts from Stack Overflow or by Andree
Published on 2010-03-19T11:48:24Z Indexed on 2010/03/19 11:51 UTC
Read the original article Hit count: 293

Filed under:
|

Hi there,

From the Jobeet tutorial provided in Symfony website, I found out that I can load fixtures data each time I run unit test by using this script:

Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures');

However, I want to delete and reload all records from database each time I run a unit test. Currently, I'm doing this manually (Run symfony doctrine:build --all before each test). Can someone provided me a correct way to do this?

© Stack Overflow or respective owner

Related posts about symfony

Related posts about doctrine