Difference between revisions of "PHPUnit"

From ArchWiki
Jump to: navigation, search
(Installing)
(Installing)
Line 9: Line 9:
 
  pear install phpunit/PHPUnit
 
  pear install phpunit/PHPUnit
  
 +
Notice that you might have to run following command before start to install phpunit
 +
#pear clear-cache
 
Done. <br>
 
Done. <br>
  

Revision as of 02:00, 27 December 2012

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 phpunit/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