Initial check in for install script for PHPunit
authorMark A. Hershberger <mah@users.mediawiki.org>
Sat, 23 Oct 2010 16:05:02 +0000 (16:05 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Sat, 23 Oct 2010 16:05:02 +0000 (16:05 +0000)
maintenance/tests/phpunit/install-phpunit.sh [new file with mode: 0755]

diff --git a/maintenance/tests/phpunit/install-phpunit.sh b/maintenance/tests/phpunit/install-phpunit.sh
new file mode 100755 (executable)
index 0000000..208b975
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+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 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 pear ); then
+    echo Installing phpunit with pear
+    pear channel-discover pear.phpunit.de
+    pear install phpunit/PHPUnit
+fi
+fi
+fi
+fi