Based on PHP 5 exception mechanism.
throw new ExceptionClass('ExceptionMessage');
First Method
return array(
......
'components'=>array(
'errorHandler'=>array(
'errorAction'=>'site/error',
),
),
);
Second Method
public function actionError()
{
if($error=Yii::app()->errorHandler->error)
$this->render('error', $error);
}
class CommentTest extends CDbTestCase
{
public $fixtures=array(
'posts'=>'Post',
'comments'=>'Comment',
);
......
}
Stored under directory protected/tests/unit
"No one knows better then Google"