Merge "Add a couple more to .gitignore"
[lhc/web/wiklou.git] / tests / phpunit / install-phpunit.sh
1 #!/bin/sh
2
3 has_binary () {
4 if [ -z `which $1` ]; then
5 return 1
6 fi
7 return 0
8 }
9
10 if [ `id -u` -ne 0 ]; then
11 echo '*** ERROR' Must be root to run
12 exit 1
13 fi
14
15 if ( has_binary phpunit ); then
16 echo PHPUnit already installed
17 else if ( has_binary pear ); then
18 echo Installing phpunit with pear
19 pear channel-discover pear.phpunit.de
20 pear channel-discover components.ez.no
21 pear channel-discover pear.symfony-project.com
22 pear install phpunit/PHPUnit
23 else if ( has_binary apt-get ); then
24 echo Installing phpunit with apt-get
25 apt-get install phpunit
26 else if ( has_binary yum ); then
27 echo Installing phpunit with yum
28 yum install phpunit
29 else if ( has_binary port ); then
30 echo Installing phpunit with macports
31 port install php5-unit
32 fi
33 fi
34 fi
35 fi
36 fi