From db574d5de612e6fb9e0d2911e394d659045e869c Mon Sep 17 00:00:00 2001 From: devosc Date: Fri, 28 Dec 2018 15:32:40 -0600 Subject: [PATCH] add phpunit to docker-php command --- bin/docker-php | 7 ++++--- lib/php/Dockerfile | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bin/docker-php b/bin/docker-php index 19810f3..43a1b6b 100755 --- a/bin/docker-php +++ b/bin/docker-php @@ -30,6 +30,7 @@ Commands: * php phpdbg phpize + phpunit php-config Options: --add-host list Add custom host-to-IP mapping, e.g example.com:192.168.10.10. @@ -68,9 +69,9 @@ if [[ -z "${args[0]}" ]]; then args=("-a") else case "${args[0]}" in - composer|git|phar|php|phpdbg|phpize|php-config ) cmd="${args[0]}" - unset "args[0]" - ;; + composer|git|phar|php|phpdbg|phpize|phpunit|php-config ) cmd="${args[0]}" + unset "args[0]" + ;; esac fi diff --git a/lib/php/Dockerfile b/lib/php/Dockerfile index 81c9b6c..ab59616 100644 --- a/lib/php/Dockerfile +++ b/lib/php/Dockerfile @@ -82,3 +82,11 @@ RUN if [ $MAIL = "true" ]; then \ echo 'sendmail_path = "/usr/sbin/ssmtp -t"' | tee $PHP_INI_DIR/conf.d/mail.ini \ && sed -i "s/mailhub=mail/mailhub=$MAIL_HOST/g" /etc/ssmtp/ssmtp.conf \ && sed -i "s/#FromLineOverride=YES/FromLineOverride=YES/g" /etc/ssmtp/ssmtp.conf; fi + +# PHPUnit +ARG PHPUNIT=true +ARG PHPUNIT_VERSION="7.5.1" +RUN if [ $PHPUNIT = "true" ]; then \ + curl -O https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar \ + && chmod +x phpunit-${PHPUNIT_VERSION}.phar \ + && mv phpunit-${PHPUNIT_VERSION}.phar /usr/local/bin/phpunit; fi