Php Fatal Error: Class 'cformmodel' Not Found [ Phpunit Tests Fails ]


I am trying to do phpunit tests in NetBeans but I am getting this error :

PHP Fatal error:  Class 'CFormModel' not found in /opt/lampp/htdocs/demo/protected/models/LoginForm.php on line 9

Let me explain:

I have netbeans 7.3.1 installed on Linux Mint. phpunit is installed as per instructions from official site, got selenium too.

I also followed instructions from Yii Rapid Application Development Hotshot book for configuring the project in netbeans:

  1. Click on File | Project Properties.

  2. In the Sources category, select the test folder (~/demo/protected/tests).

  3. In the PHPUnit category, activate Use Bootstrap, and select the Bootstrap file (~/demo/protected/tests/bootstrap.php). Then

activate Use XML Configuration and select the XML configuration file (~/demo/protected/tests/phpunit.xml).

  1. In the PHP Include Path category, add the Yii Framework root (/opt/lampp/htdocs/yii) and PHPUnit (/opt/lampp/lib/ph/PHPUnit).

  2. Open Tools | Options | Miscellaneous | Files and in the field Files Ignored by the IDE add yiilite\.php| in front of CVS.

I can successfully run calculator example phpunit test : NetBeans site example

If I try to put this test inside yii project it works too, but If I try running Create PHPUnit Tests on any yii class that is extended from some other class like any model or controller class I get previously mentioned error. So if I try running Create PHPUnit Tests on LoginForm.php, netbeans will create folder "models" under "protected" folder in test files, but it will not create LoginFormTest.php file.

Do anyone have any clue what is wrong here ?