Skip to content

Commit 3bd852d

Browse files
committed
Minimum PHP 8.2 refactoring, updated db versions for multi-db testing
1 parent cab10e0 commit 3bd852d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

run-tests-against-multiple-db-versions-docker.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ function readableElapsedTime($microtime, $format = null, $round = 3) {
6868
$console_prompt2 = "Please enter a password that would be used for the Mysql & Mariadb root accounts:";
6969
$mysql_root_psw = readFromLine(PHP_EOL . $console_prompt2);
7070

71-
$test_results = [];
71+
$test_results = [];
72+
$test_failures = [];
7273

7374
$mysql_maria_db_sql_dsn = 'mysql:host=127.0.0.1;port=3306';
7475
$mysql_user = 'root';
@@ -294,9 +295,7 @@ function readableElapsedTime($microtime, $format = null, $round = 3) {
294295
// see https://github.com/sebastianbergmann/phpunit/blob/10.5/src/TextUI/ShellExitCodeCalculator.php
295296
// for phpunit shell exit codes
296297
////////////////////////////////////////////////////////////////////////
297-
echo PHP_EOL . "Test failed for the following databases:" . PHP_EOL . $db_versions;
298-
echo PHP_EOL . 'Goodbye!'. PHP_EOL;
299-
exit(1);
298+
$test_failures[] = $db_versions;
300299

301300
} eLse {
302301

@@ -321,7 +320,14 @@ function readableElapsedTime($microtime, $format = null, $round = 3) {
321320
echo $test_result . PHP_EOL;
322321

323322
} // foreach ($test_results as $test_result)
324-
} // if (count($test_results) > 0)
323+
} else if(count($test_failures) > 0){
324+
325+
echo PHP_EOL . "Test failed for the following databases:" . PHP_EOL . PHP_EOL;
326+
echo implode(PHP_EOL . PHP_EOL, $test_failures);
327+
328+
}// if (count($test_results) > 0)
325329

326330
echo PHP_EOL . 'Time taken: ' . readableElapsedTime($elapsed). PHP_EOL. PHP_EOL;
327331
echo PHP_EOL . 'Goodbye!'. PHP_EOL;
332+
333+
($test_failures !== []) && exit(1);

0 commit comments

Comments
 (0)