diff --git a/tests/p_php/php-test.sh b/tests/p_php/php-test.sh new file mode 100755 index 0000000..88c1457 --- /dev/null +++ b/tests/p_php/php-test.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# Author: Athmane Madjoudj +# Author: Christoph Galuschka + +t_Log "Running $0 - php functional test." + +# Comparing hostname with output of phpinfo() +HOST=$(hostname) +FILE='/var/tmp/php-test.php' + +cat > $FILE < +EOF + +# setting timezone for phpinfo +sed -i 's/\;date\.timezone\ \=/date\.timezone = \"Europe\/Berlin\"/' /etc/php.ini + +php $FILE | grep -cq 'HOSTNAME => '$HOST + +t_CheckExitStatus $? + +#reversing changes +/bin/rm $FILE +sed -i 's/\date\.timezone\ \=\ \"Europe\/Berlin\"/\;date\.timezone\ \=/' /etc/php.ini