renderPartial in model during unit testing

In my model, I use the (swift)mailer extension to construct and send email.

Problem comes when I am doing unit testing on the model. Inside the mailer extension there is part that requires


But controller seems not loaded

PHP Fatal error:  Call to a member function renderPartial() on a non-object

How do I solve this?

anyone? tried using


but still the controller doesn’t initialize.

please help!