Tip #6: Fixture Rollback
If you use fixtures, the fixture data is removed from the database after the corresponding test finishes. But it’s important to note, that there is no transaction rollback, instead all tables affected by the fixture will be truncated after the test.
This has some implications:
- You shouldn’t ever use table fixtures with tables that contain important core data, like
- Data in tables, not contained in the fixture, stay. You can trigger deletion of data created during test with an empty fixture, for example for quotes and orders:
tables: sales/quote:  sales/order: 
- If this behavior is not desired, you should clean up behind yourself, i.e. delete created data in a
- Don’t rely too much on data present in the original database, as other tests might overwrite and eventually delete it with their fixtures
- If you use shared fixtures with
@loadSharedFixtureall data in the shared fixture is only created and removed once. All tables affected by a shared fixture will not be cleaned up in between at all, even if other normal fixtures add data. My advice: Use shared fixtures with caution, or better not at all.