2010-12-14 16:26:35 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
2010-12-19 05:08:21 +00:00
|
|
|
has_binary () {
|
|
|
|
|
if [ -z `which $1` ]; then
|
|
|
|
|
return 1
|
|
|
|
|
fi
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-14 16:26:35 +00:00
|
|
|
if [ `id -u` -ne 0 ]; then
|
2013-03-20 05:14:49 +00:00
|
|
|
echo '*** ERROR: Must be root to run'
|
2010-12-14 16:26:35 +00:00
|
|
|
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
|
2010-12-21 18:11:22 +00:00
|
|
|
pear channel-discover components.ez.no
|
2012-12-15 00:51:39 +00:00
|
|
|
pear channel-discover pear.symfony.com
|
|
|
|
|
pear update-channels
|
2014-05-09 10:08:55 +00:00
|
|
|
#Temporary fix for 64597
|
|
|
|
|
pear install --alldeps phpunit/PHPUnit-3.7.35
|
2010-12-14 16:26:35 +00:00
|
|
|
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
|
2011-06-04 21:34:07 +00:00
|
|
|
else if ( has_binary port ); then
|
2011-06-04 21:32:51 +00:00
|
|
|
echo Installing phpunit with macports
|
|
|
|
|
port install php5-unit
|
|
|
|
|
fi
|
2010-12-14 16:26:35 +00:00
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
fi
|