Improve PHPUnit install

This commit is contained in:
cytopia
2022-12-07 19:18:33 +01:00
parent 887e7c67c5
commit 39b32384b6
14 changed files with 105 additions and 21 deletions

View File

@@ -323,8 +323,14 @@ RUN set -eux \
# -------------------- (custom) phpunit --------------------
RUN set -eux \
&& PHP_UNIT_VERSION="9" \
&& curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit \
&& PHP_UNIT_VERSION="" \
&& if [ -n "${PHP_UNIT_VERSION}" ]; then \
PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \
else \
PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \
fi \
&& curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \
\
&& chmod +x /usr/local/bin/phpunit \
&& phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false) \
&& true