Phpunit For Database Migration

hello friend,

i am working with one yii project on which i am doing phpunit test to create any module or functionality. now i got stuck with yii migration database. can i create any phpunit test case for database migration… i don’t think so… please advice me.

Hi,

What would you like to test in the migration? Unit test are used to test individual units of source code.

Maybe this will help you Testing.

Unit tests are supposed to protect your code from bugs when changes occur. They allow you to improve your software with confidence that it will behave as planned.

Since migrations should not change after being deployed, it’s sufficient to test them manually when writing them. At least that’s how it is in my case.