From a7602a54fce218ed84eefe3e3776a368afb132db Mon Sep 17 00:00:00 2001 From: Alexandre Quercia Date: Mon, 1 Jan 2024 16:45:05 +0100 Subject: [PATCH] fix(test): adjust dependencies for PHP 8 --- require_for_php8.txt | 2 ++ test/bin/test | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 require_for_php8.txt diff --git a/require_for_php8.txt b/require_for_php8.txt new file mode 100644 index 000000000..b4e981be3 --- /dev/null +++ b/require_for_php8.txt @@ -0,0 +1,2 @@ +swiftmailer/swiftmailer:^5.4.6 +egulias/email-validator:^2.1.10 diff --git a/test/bin/test b/test/bin/test index a861eabbe..a6d2357e2 100755 --- a/test/bin/test +++ b/test/bin/test @@ -23,6 +23,7 @@ main () populatePHPVersions tearDownRegisterFunction reset_submodules + tearDownRegisterFunction reset_composer_json runTests } @@ -181,7 +182,24 @@ install_lowest () reset_submodules ${INSTALL_GIT_SUB_MODULE} - ${DOCKER_COMPOSE_EXEC} ${c_service} ${COMPOSER_UPDATE} --prefer-lowest + cp "${ROOT_DIR}/composer.json" "${ROOT_DIR}/composer.json~" + + if test 80 -le `echo "${c_service}" | sed 's/^php//'`; then + c_depFlags=`cat ${ROOT_DIR}/require_for_php8.txt` + + ${DOCKER_COMPOSE_EXEC} ${c_service} ${COMPOSER_REQUIRE} ${c_depFlags} --prefer-lowest --update-with-all-dependencies + else + ${DOCKER_COMPOSE_EXEC} ${c_service} ${COMPOSER_UPDATE} --prefer-lowest + fi + + reset_composer_json +} + +reset_composer_json () +{ + if test -f "${ROOT_DIR}/composer.json~"; then + mv "${ROOT_DIR}/composer.json~" "${ROOT_DIR}/composer.json" + else :; fi } reset_submodules ()