aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/install-phpunit.sh
diff options
context:
space:
mode:
authorChad Horohoe <demon@users.mediawiki.org>2010-12-14 16:26:35 +0000
committerChad Horohoe <demon@users.mediawiki.org>2010-12-14 16:26:35 +0000
commit23f69f10ed07c7fbe7d752882a88d55351ce2e3d (patch)
tree43054aea852645def63951fcbf45eb2cf2551adb /tests/phpunit/install-phpunit.sh
parent5903e492a5c60f65182d6339f63693aa2dca92f0 (diff)
downloadmediawikicore-23f69f10ed07c7fbe7d752882a88d55351ce2e3d.tar.gz
mediawikicore-23f69f10ed07c7fbe7d752882a88d55351ce2e3d.zip
Per wikitech-l discussion: Move tests from maintenance/tests/ to tests/. They're not strictly maintenance scripts, and some people want to do a selective checkout that doesn't include the tests. There's still debate on whether we should include these in the release downloads, but we had a pretty firm consensus to move this.
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/78383
Diffstat (limited to 'tests/phpunit/install-phpunit.sh')
-rwxr-xr-xtests/phpunit/install-phpunit.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/phpunit/install-phpunit.sh b/tests/phpunit/install-phpunit.sh
new file mode 100755
index 000000000000..aca7ace6e527
--- /dev/null
+++ b/tests/phpunit/install-phpunit.sh
@@ -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 pear ); then
+ echo Installing phpunit with pear
+ pear channel-discover pear.phpunit.de
+ 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
+fi
+fi
+fi
+fi