I’m using netbeans, I have several test, and they work ok.
If I test my db cx it works, even If I use the Yii:app() objet
public function testConnection(){
$cx=Yii::app()->db;
$this->assertNotEquals(NULL, $cx);
}
A functional testing is not the solution in my case because I’m testing a model with a function that sends an email, there is where I use the partial render for the email body.
I meant you, of course, have an application instantiated but it’s done via bootstrap script: you are not processing web request so no controller is being used and you can’t get it from your Model.
Thanks imehesz, I think I should move my sending email code from the model. So, to have a unit test for the sending email function I should use a funtional test?