Unable To Run Unit Tests For Code That Includes Yii::t

When using PHP unit to run a unit test for code that includes a call to Yii::t an include error occurs.

I have a module called sms that contains a directory messages with a messages file called sms inside it. The Yii::t calls look like this:

echo Yii::t('smsModule.sms', 'Some message');

This works perfectly fine in web applications and in command line apps.

In a unit test, however, specifically a CDbTestCase, this code causes an error:

include(smsModule.php): failed to open stream: No such file or directory









I’m not familiar enough with the internals of Yii to understand why this is happening. Can anyone shed some light on what is going on here and how I can work around this?

Edit The reason seems to be something to do with capitalization. If I change the Yii::t call to

echo Yii::t('SmsModule.sms', 'Some message');

it works.

Still, this is not needed for web applications and for command line applications, so there seems to be a difference between unit tests and those other two situations, which can’t be right, no?