PHPUnit installation problem

Though this is not appropriate place to ask PEAR related issues, I was faced to the problem during ‘build’ command of Yii.

According to the README, I issued following command, and I saw following error message.




$ ./build  message ../framework/messages/config.php

PHP Warning:  require_once(PHPUnit/Runner/Version.php): failed to open stream: No such file or directory in /var/www/html/yii/build/build on line 16

PHP Fatal error:  require_once(): Failed opening required 'PHPUnit/Runner/Version.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/yii/build/build on line 16

It seemed to me that PEAR/PHPUnit is not installed, but it might be installed correctly.




$ pear install PHPUnit

pear/PHPUnit is already installed and is the same as the released version 1.3.2

install failed

Does anybody out there know how to do ‘build’?

Thanks in advance.

Looks like you don’t have PEAR in your PHP include path. :)

I am curios:

Why do you want to build it?

Just install PHPUnit and download Selenium RC and start testing - following the Yii Definitive Guide.

Here’s how you install it:

And then it’s ready to use.

No building anything.

I did that yesterday myself, and that was all it took.

You can now run phpunit in a command prompt in the protected/test directory.

3.5? http://sebastian-bergmann.de/archives/899-PHPUnit-3.5-Upgrading-Woes.html

You can ignore me.

I didn’t realise that you were talking about SVN trunk, and it has a build script in it.

Didn’t know you need to build Yii source to make a release.

You learn something new all the time. :)

What I do notice, however, is that PEAR is not in your php paths in the php directory.

It is in /usr/share/pear, but not in /usr/share/php/PEAR - check that.

The version number also indicates an old version…

Dear Sir

I follow this instruction to install phpunit and got the error below;

(Other steps before this install is ok)

C:\wamp\bin\php\php5.3.0>pear install phpunit/PHPUnit

phpunit/PHPUnit can optionally use PHP extension "dbus"

phpunit/PHPUnit can optionally use PHP extension "soap"

downloading PHPUnit-3.5.10.tgz …

Starting to download PHPUnit-3.5.10.tgz (117,454 bytes)

…done: 117,454 bytes

Could not delete C:\wamp\bin\php\php5.3.0\phpunit, cannot rename C:\wamp\bin\php

\php5.3.0\.tmpphpunit

ERROR: commit failed

I had the same problem, I’m not sure if is a true solution, but I’ve added to yii\framework\test\CTestCase.php this include:

set_include_path (‘C:/wamp/bin/php/php5.3.9/pear’); (absolute path to pear)

and phpunit work fine.