summaryrefslogtreecommitdiff
path: root/tests/phpunit/install-phpunit.sh
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
committerPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
commitca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch)
treeec04cc15b867bc21eedca904cea9af0254531a11 /tests/phpunit/install-phpunit.sh
parenta22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff)
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing
Diffstat (limited to 'tests/phpunit/install-phpunit.sh')
-rw-r--r--tests/phpunit/install-phpunit.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/phpunit/install-phpunit.sh b/tests/phpunit/install-phpunit.sh
new file mode 100644
index 00000000..2d2b53ab
--- /dev/null
+++ b/tests/phpunit/install-phpunit.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+has_binary () {
+ if [ -z `which $1` ]; then
+ return 1
+ fi
+ return 0
+}
+
+if [ `id -u` -ne 0 ]; then
+ echo '*** ERROR' Must be root to run
+ exit 1
+fi
+
+if ( has_binary phpunit ); then
+ echo PHPUnit already installed
+else if ( has_binary pear ); then
+ echo Installing phpunit with pear
+ pear channel-discover pear.phpunit.de
+ pear channel-discover components.ez.no
+ pear channel-discover pear.symfony-project.com
+ pear install phpunit/PHPUnit
+else if ( has_binary apt-get ); then
+ echo Installing phpunit with apt-get
+ apt-get install phpunit
+else if ( has_binary yum ); then
+ echo Installing phpunit with yum
+ yum install phpunit
+else if ( has_binary port ); then
+ echo Installing phpunit with macports
+ port install php5-unit
+fi
+fi
+fi
+fi
+fi