wiki.techinc.nl/tests/phpunit/install-phpunit.sh
physikerwelt (Moritz Schubotz) 3ca5ecb486 Fix PHPUnit version to 3.7.35
"MediaWiki tries to require PHPUnit files directly,
but the phpunit/phpunit PEAR channel now falls back to the PHAR
method (install a single file, /usr/bin/phpunit, with all classes
packed inside it)." (from the bug report)

Bug: 64597
Change-Id: Ib93b32473ab1a96ea97d90c15fd3675e8ec9843c
2014-05-10 11:20:06 +00:00

38 lines
871 B
Bash
Executable file

#!/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.com
pear update-channels
#Temporary fix for 64597
pear install --alldeps phpunit/PHPUnit-3.7.35
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