Unti tests - fixtures


I was trying to make some Unit tests on my app. I’ve got fixtures for tables there, but i don’t want to have all of them to be truncated every-time a I run test. I.E.: I’ve got User.php fixture for User table in db and as I did read Guide I have created file User.init.php in fixtures file. But what should i put in this file? I have tried putting just <?php return; ?> in there, but my table still got truncated…

Thx for any advice!

Old post, but I could not find an answer on this forum. Maybe I wasn’t looking hard enough.

The .init.php is sourced with the php command ‘require()’ when loading the fixture files.

As an example, I wanted to remove all rows in the database (model Post) with an id greater than 8:


    Post::model()->deleteAll('id>:lastId', array(':lastId'=><img src='http://www.yiiframework.com/forum/public/style_emoticons/default/cool.gif' class='bbc_emoticon' alt='8)' />);