Difference between revisions of "PHPUnit"

From ArchWiki
Jump to: navigation, search
m (updated pear commands from Sebastians page)
(Installing)
Line 5: Line 5:
 
  pacman -S php-pear
 
  pacman -S php-pear
  
Now you can do just like the [http://www.phpunit.de/manual/current/en/installation.html ''official documentation'']. As root, just type
+
Now you can do just like the [http://www.phpunit.de/manual/current/en/installation.html ''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 config-set auto_discover 1
 
  pear install pear.phpunit.de/PHPUnit
 
  pear install pear.phpunit.de/PHPUnit

Revision as of 15:25, 21 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 pear.phpunit.de/PHPUnit

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