I'm After reading other similar posts I felt I've followed everything to the letter, hence my confusion and this post:
I'm running: - Windows 7 64bit - Wamp Server 2.0 with php 5.2.5
I'm reading the packt Agile Web Development with Yii and PHP5
Actions so far:
- Installed PEAR in c:\wamp\bin\php5.2.5\PEAR\pear (it created a subfolder inside 'PEAR')
- Installed and Setup Selenium RC
- Added the PEAR_ENV.reg file for Environment Variables
- Restarted and Confirmed PEAR is working by typing 'pear' in command prompt (works in any subfolder as well)
- Installed PHPUnit via PEAR and confirmed 'phpunit' is working via command prompt. Tested phpunit with selenium for the Yii testcase at 'functional/SiteTest.php'
- changed and tested the include_path in both php.ini files (in the php5.2.5 folder and the apache folder) to 'c:\wamp\bin\php5.2.5\PEAR\pear'. Turns out both need to be the same for phpunit and pear to work (?)
The problem: the following command works when I type via command prompt:
cd c:\wamp\www\yiidemo\protected\tests
phpunit functional\SiteTest.php
phpunit works with selenium for testing the site with firefox.
But when I create an empty class for testing as stated in the book and run this:
phpunit unit\MessageTest.php
I get this:
"Warning: require(PHPUnit/Autoload.php): failed to open stream: No such file or directory in c:\wamp\www\yiidemo\protected\tests\unit\MessageTest.php"
But if I enter the unit folder and try the command:
phpunit MessageTest.php
I get an error message stating
"Fatal Error: Class 'CTestCase' not found in "c:\wamp\www\yiidemo\protected\tests\unit\MessageTest.php" on line 3
<?php
class MessageTest extends CTestCase
{
}
?>
Any idea what I'm doing wrong. I've come a long way to this point and quite stuck since the command lines are working.