Difference between revisions of "PHPUnit"

From ArchWiki
Jump to: navigation, search
(Installing)
(Installing: Corrected a wrong instruction)
Line 7: Line 7:
 
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
 
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 phpunit/PHPUnit
+
  pear install pear.phpunit.de/PHPUnit
  
 
Notice that you might have to run following command before start to install phpunit
 
Notice that you might have to run following command before start to install phpunit

Revision as of 12:20, 17 February 2013

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