Skip to content

Commit db574d5

Browse files
committed
add phpunit to docker-php command
1 parent 1568e42 commit db574d5

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

bin/docker-php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Commands:
3030
* php
3131
phpdbg
3232
phpize
33+
phpunit
3334
php-config
3435
Options:
3536
--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
6869
args=("-a")
6970
else
7071
case "${args[0]}" in
71-
composer|git|phar|php|phpdbg|phpize|php-config ) cmd="${args[0]}"
72-
unset "args[0]"
73-
;;
72+
composer|git|phar|php|phpdbg|phpize|phpunit|php-config ) cmd="${args[0]}"
73+
unset "args[0]"
74+
;;
7475
esac
7576
fi
7677

lib/php/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,11 @@ RUN if [ $MAIL = "true" ]; then \
8282
echo 'sendmail_path = "/usr/sbin/ssmtp -t"' | tee $PHP_INI_DIR/conf.d/mail.ini \
8383
&& sed -i "s/mailhub=mail/mailhub=$MAIL_HOST/g" /etc/ssmtp/ssmtp.conf \
8484
&& sed -i "s/#FromLineOverride=YES/FromLineOverride=YES/g" /etc/ssmtp/ssmtp.conf; fi
85+
86+
# PHPUnit
87+
ARG PHPUNIT=true
88+
ARG PHPUNIT_VERSION="7.5.1"
89+
RUN if [ $PHPUNIT = "true" ]; then \
90+
curl -O https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar \
91+
&& chmod +x phpunit-${PHPUNIT_VERSION}.phar \
92+
&& mv phpunit-${PHPUNIT_VERSION}.phar /usr/local/bin/phpunit; fi

0 commit comments

Comments
 (0)