I’m on an ubuntu server trying to install phpunit as per the instructions in Agile Web Development with Yii.
When I run this:
[sub]
phpunit unit/dbTest.php
[/sub]
I get this:
[sub]
PHP Warning: require_once(PHPUnit/Autoload.php): failed to open stream: No such file or directory in /opt/yii-1.1.10.r3566/framework/test/CTestCase.php on line 12
[/sub]
At this stage i don’t have selenium working. Could someone please verify what should happen when i execute this command WITHOUT the selenium server running?
Kind thanks,
phpunit --version
PHPUnit 3.4.5 by Sebastian Bergmann.
php --version
PHP 5.3.10
pear list phpunit/phpunit
…
php /opt/php5.3.10/lib/php/PHPUnit/Autoload.php (this is on my php.ini include path)
Seems like loadsa people have had similar problems with this.
Realisied the only way to solve it is to manually download and install all the necessary parts of phpunit and solve any dependencies that come up. Just make sure you get the directory structure ok.
Don’t use apt-get and don’t use PEAR
Then in WebTestCase i added:
set_include_path (’/opt/php5.3.10/lib/php’);
At the root of that path i have the following directories - PEAR, PHP, PHPUNIT, File
Took quite a while to sort this last nite, hope it helps anyone else struggling with this on ubuntu.
I ran into the same problem when I went through the guide. My tests run ok if I run them from the php directory and use the full path to the test file instead of trying to run the phpunit command from the same directory as the test file.
Your system is looking for the PHPUnit/Autoload.php file in the /opt/yii-1.1.10.r3566/framework/test/ directory and it won’t find it there.