1
我發現例如如何在手動PHPUnit的,使用其他的固定裝置在yii1
class CommentTest extends CDbTestCase
{
public $fixtures=array(
'posts'=>'Post',
'comments'=>'Comment',
);
…
}
使用夾具或我可以使用像這樣的「後」 =>「:交」。 但我想在其他測試中使用其他燈具,例如:當我測試模型時,我使用「post.php」燈具,當我測試模型作者我想用post_for_author.php(數據必須插入表後)
我嘗試寫這樣的:
class CommentTest extends CDbTestCase
{
public $fixtures=array(
'posts_for_author'=>'Post',
'comments'=>'Comment',
);
…
}
等方式 'posts_for_author'=> ':後', 但它不工作。請幫幫我,怎麼辦?
再次謝謝! – ConorHolt