Skip to content

Commit a7602a5

Browse files
committed
fix(test): adjust dependencies for PHP 8
1 parent b964f72 commit a7602a5

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

require_for_php8.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
swiftmailer/swiftmailer:^5.4.6
2+
egulias/email-validator:^2.1.10

test/bin/test

+19-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ main ()
2323
populatePHPVersions
2424

2525
tearDownRegisterFunction reset_submodules
26+
tearDownRegisterFunction reset_composer_json
2627

2728
runTests
2829
}
@@ -181,7 +182,24 @@ install_lowest ()
181182
reset_submodules
182183
${INSTALL_GIT_SUB_MODULE}
183184

184-
${DOCKER_COMPOSE_EXEC} ${c_service} ${COMPOSER_UPDATE} --prefer-lowest
185+
cp "${ROOT_DIR}/composer.json" "${ROOT_DIR}/composer.json~"
186+
187+
if test 80 -le `echo "${c_service}" | sed 's/^php//'`; then
188+
c_depFlags=`cat ${ROOT_DIR}/require_for_php8.txt`
189+
190+
${DOCKER_COMPOSE_EXEC} ${c_service} ${COMPOSER_REQUIRE} ${c_depFlags} --prefer-lowest --update-with-all-dependencies
191+
else
192+
${DOCKER_COMPOSE_EXEC} ${c_service} ${COMPOSER_UPDATE} --prefer-lowest
193+
fi
194+
195+
reset_composer_json
196+
}
197+
198+
reset_composer_json ()
199+
{
200+
if test -f "${ROOT_DIR}/composer.json~"; then
201+
mv "${ROOT_DIR}/composer.json~" "${ROOT_DIR}/composer.json"
202+
else :; fi
185203
}
186204

187205
reset_submodules ()

0 commit comments

Comments
 (0)