#!/bin/bash
#
# Command line script helper to run PHPUnit tests on supported PHP versions
# using Docker containers.
#
# Copyright © Fernando Val
#
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
# Colors
Color_Off='\033[0m'
Blue='\033[0;34m'
Green='\033[0;32m'
Yellow='\033[1;33m'
White='\033[0;37m'
BWhite='\033[1;37m'
set -e
cd $SCRIPTPATH/../..
echo ""
echo -e "${Green}Running PHPUnit tests on PHP 8.1${Color_Off}"
echo -e "${Green}--------------------------------${Color_Off}"
docker run --rm -v $(pwd):/var/www -w /var/www php:8.1 vendor/bin/phpunit
echo ""
echo ""
echo -e "${Green}Running PHPUnit tests on PHP 8.2${Color_Off}"
echo -e "${Green}--------------------------------${Color_Off}"
docker run --rm -v $(pwd):/var/www -w /var/www php:8.2 vendor/bin/phpunit
echo ""
echo ""
echo -e "${Green}Running PHPUnit tests on PHP 8.3${Color_Off}"
echo -e "${Green}--------------------------------${Color_Off}"
docker run --rm -v $(pwd):/var/www -w /var/www php:8.3 vendor/bin/phpunit
echo ""
|