@@ -247,12 +247,16 @@ function readableElapsedTime($microtime, $format = null, $round = 3) {
247247
248248 $ retval =null ;
249249 $ output =null ;
250+ $ sanitized_db_version_name = \str_replace ([': ' ,'. ' ],['_ ' , '_ ' ], $ db_version );
250251 $ run_container_command = \str_replace (
251252 $ runtime_name_placeholder ,
252- $ db_version ,
253+ $ sanitized_db_version_name ,
253254 $ command ['run_container ' ]
254255 );
255- $ container_names_to_stop [] = $ db_versions ;
256+ $ container_names_to_stop [] = [
257+ 'container_name ' =>$ sanitized_db_version_name ,
258+ 'image_name ' =>$ db_version ,
259+ ];
256260 echoWithLineBreaks ($ run_container_command );
257261 exec ($ run_container_command , $ output , $ retval );
258262
@@ -279,12 +283,12 @@ function readableElapsedTime($microtime, $format = null, $round = 3) {
279283
280284 foreach ($ container_names_to_stop as $ container_to_stop ) {
281285
282- echoWithLineBreaks ("docker stop {$ container_to_stop }" );
283- system ("docker stop {$ container_to_stop }" ); // stop the containers
286+ echoWithLineBreaks ("docker stop {$ container_to_stop[ ' container_name ' ] }" );
287+ system ("docker stop {$ container_to_stop[ ' container_name ' ] }" ); // stop the containers
284288
285289 // remove their images from the machine to save disk space
286- echoWithLineBreaks ("docker image rm --force {$ container_to_stop }" );
287- system ("docker image rm --force {$ container_to_stop }" );
290+ echoWithLineBreaks ("docker image rm --force {$ container_to_stop[ ' image_name ' ] }" );
291+ system ("docker image rm --force {$ container_to_stop[ ' image_name ' ] }" );
288292 }
289293
290294 if ($ phpunit_retval !== 0 ) {
0 commit comments