You should set up a separate database for testing and put the details and credentials in your test config file. When you run your tests, for each fixture that you’ve specified in your test class, Yii will truncate the appropriate table in the test database and insert the relevant fixture data.