From 09ac5f3f85b4ed87f331324fea71d20f3a980851 Mon Sep 17 00:00:00 2001 From: cytopia Date: Tue, 18 Dec 2018 14:47:09 +0100 Subject: [PATCH] Fix check against PHP version --- .tests/intra-tests/php-xdebug.sh | 10 +++++----- .tests/intra-tests/vendor-phpredmin.sh | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.tests/intra-tests/php-xdebug.sh b/.tests/intra-tests/php-xdebug.sh index 7713fb29..54f721db 100755 --- a/.tests/intra-tests/php-xdebug.sh +++ b/.tests/intra-tests/php-xdebug.sh @@ -5,7 +5,7 @@ set -u set -o pipefail -DISABLED_VERSIONS=("7.2") +DISABLED_VERSIONS=("7.4") # @@ -20,15 +20,15 @@ DISABLED_VERSIONS=("7.2") printf "[TEST] Get PHP version" # 1st Try -if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' | grep -Eo '\([.0-9]+\)' | grep -Eo '[0-9]+\.[0-9]+' )"; then +if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' | grep -Eo '\([.0-9]+' | grep -Eo '[0-9]+\.[0-9]+' )"; then # 2nd Try sleep 1 - if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' | grep -Eo '\([.0-9]+\)' | grep -Eo '[0-9]+\.[0-9]+' )"; then + if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' | grep -Eo '\([.0-9]+' | grep -Eo '[0-9]+\.[0-9]+' )"; then # 3rd Try sleep 1 - if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' | grep -Eo '\([.0-9]+\)' | grep -Eo '[0-9]+\.[0-9]+' )"; then + if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' | grep -Eo '\([.0-9]+' | grep -Eo '[0-9]+\.[0-9]+' )"; then printf "\r[FAIL] Get PHP version\n" - curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' || true + curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' || true exit 1 else printf "\r[OK] Get PHP version (3 rounds): %s\n" "${PHP_VERSION}" diff --git a/.tests/intra-tests/vendor-phpredmin.sh b/.tests/intra-tests/vendor-phpredmin.sh index 9ced6e7f..dfa07c3b 100755 --- a/.tests/intra-tests/vendor-phpredmin.sh +++ b/.tests/intra-tests/vendor-phpredmin.sh @@ -49,15 +49,15 @@ fi printf "[TEST] Get PHP version" # 1st Try -if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' | grep -Eo '\([.0-9]+\)' | grep -Eo '[0-9]+\.[0-9]+' )"; then +if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' | grep -Eo '\([.0-9]+' | grep -Eo '[0-9]+\.[0-9]+' )"; then # 2nd Try sleep 1 - if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' | grep -Eo '\([.0-9]+\)' | grep -Eo '[0-9]+\.[0-9]+' )"; then + if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' | grep -Eo '\([.0-9]+' | grep -Eo '[0-9]+\.[0-9]+' )"; then # 3rd Try sleep 1 - if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' | grep -Eo '\([.0-9]+\)' | grep -Eo '[0-9]+\.[0-9]+' )"; then + if ! PHP_VERSION="$( curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' | grep -Eo '\([.0-9]+' | grep -Eo '[0-9]+\.[0-9]+' )"; then printf "\r[FAIL] Get PHP version\n" - curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+\)' || true + curl -sS localhost/index.php | tac | tac | grep -Eo 'PHP.*?\([.0-9]+' || true exit 1 else printf "\r[OK] Get PHP version (3 rounds): %s\n" "${PHP_VERSION}" @@ -70,16 +70,16 @@ else fi + ### ### Ensure only to check against desired versions ### if [[ ! ${DISABLED_VERSIONS[*]} =~ ${PHP_VERSION} ]]; then -### -### Ensure PHPRedmin works in subdirectory -### - + ### + ### Ensure PHPRedmin works in subdirectory + ### URL="/vendor/phpredmin/public/index.php/welcome/info/0/0" printf "[TEST] Fetch ${URL}"