PHPUnit

From ArchWiki
Revision as of 12:20, 17 February 2013 by Slopjong (Talk | contribs) (Installing: Corrected a wrong instruction)

Jump to: navigation, search

Installing

First of all, you need PEAR to install PHPUnit.

pacman -S php-pear

Now you can do just like the official documentation. As root (sudo will NOT be enough, You'll have to do this as "real" root), just type

pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit

Notice that you might have to run following command before start to install phpunit

#pear clear-cache

Done.

Running

For running PHPUnit properly you must have the /usr/bin/ directory listed in the open_basedir option at the /etc/php/php.ini

open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/bin/

Or just unset it

open_basedir =

Additional

In some php framework, you will meet the error of missing Selenium. Just install the selenium package with pear ( make sure you have root right )

 pear install phpunit/PHPUnit_Selenium