Hi, i’m starting with the Yii framework, following the Book 'Agile Web Application Development with Yii 1.1 and PHP5", and i’m kind of stuck.
I’ve to install PHPunit and selenium-server(wich i dont know how to use), but i made it to install both and start testing with the PHPUnit, but i’m getting several error messages when i try to run the excersises.
This is what i did.
on Windows Console i go to my webapp file and then
cd protected/tests
phpunit functional/SiteTest
i got this Error Message
Class functional/SiteTest coulld not be found in functional/SiteTest.php
Then after some searching on the web i find that i must be on the .php file before tested.
then i did this
cd protected/tests/functional
phpunit SiteTest
...
Time:00:00
OK (2 tests)
Following the book it says that i must try with the WebTestCase.php file
so i did this
-->cd protected/tests
-->phpunit WebTestCase.php
This is what i get
-->PHP Fatal error: Class 'CWebTestCase' not Found in C:\..\WebRoot\demo\protected\tests\WebTestCase.php on line 16
-->Fatal Error: Class 'CWebTestCase' not found in C:\..\WebRoot\demo\protected\tests\WebTestCase.php on line 16
after many hours of trying to fixed i give up and keep throght with the book, but then i unfortunately find another error like the one before.
I was told to do This, create a unit Test, called "MessageTest.php" and store in "protected\test\unit", a that file contains
<? php class MessageTest extends CTestCase {} ?>
after this i should tested it with phpunit
i did this
--> cd /protected/test/unit
--> phpunit MessageTest.php
-->PHP Fatal Error: Class 'CTestCase' not Found in C:\..\webroot\demo\protected\tests\unit\MessageTests.php on line 3
-->Fatal Error: Class 'CTestCase' not Found in C:\..\webroot\demo\protected\tests\unit\MessageTests.php on line 3
For what i could understand the Extends of the Yii Framework/tests classes are invisible to the phpunit. I’ve trying to fixed unsuccessfully. I’m right now sick of this, i could keep reading the book but for what i see, i need this commands to in right performance, but i dont know what i could do.
If you need any other info to help to fix my problem i could give it, thanks
PD:
this is mi Windows console path (only the ones relevant for this problem):
PATH=C:\ApacheServer\php\;C:\ApacheServer\www\Yii;C:\ApacheServer\www\Yii\Framework;
and this is my include_path on the php.ini
include_path = ".;c:\ApacheServer\php\;c:\ApacheServer\www\Yii\"
i modified both of then a lot of times trying to solve this.
this are the routes of Apache, PHP 5, Phpunit.bat, my WebRoot and Yii
c:\ApacheServer\Apache <<< Apache
c:\ApacheServer\PHP5 <<< PHP5
c:\ApacheServer\PHP5 <<< Phpunit.bat
c:\ApacheServer\www\ <<< WebRoot
c:\ApacheServer\www\Yii <<< Yii