ProjectTest.php error on unit testing

During PHPUnit test on ProjectTest.php i am getting an Error :-

CDbException: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (trackstar_test.tbl_comment, CONSTRAINT FK_comment_issue FOREIGN KEY (issue_id) REFERENCES tbl_issue (id))

I am using Yii 1.1.8 and PHPunit 3.6.6 test suite. for more check code and screenshot.

It looks like more database issue than yii.

You’re trying to delete a record which is related to another table. If you set the “on delete cascade” in your database for the relationship, it should work. But maybe you would prefer not cascading.

I hope it will help you.