Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Commit b058be9

Browse files
committed
Add bin/test bash file to perform PHPUnit test using Docker
1 parent 870d922 commit b058be9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

bin/test

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# name=$([ "$1" ] && echo "$1" || echo default)
6+
version="7.4"
7+
declare -a versions=("7.3" "7.4" "8.0")
8+
9+
if [[ " ${versions[*]} " == *"$1"* ]];
10+
then
11+
version="$1"
12+
else
13+
echo "PHP version '$1' is not supported."
14+
IFS=', ';echo "We suggest to select one of the following options: ${versions[*]}"
15+
echo "Test will run using default version $version"
16+
fi
17+
18+
echo $version
19+
20+
# for version in "${versions[@]}"
21+
# do
22+
docker run -it --rm \
23+
-e "TERM=xterm-256color" \
24+
-v "$PWD":/usr/src \
25+
-w /usr/src \
26+
php:"$version"-cli-alpine \
27+
vendor/bin/phpunit
28+
# done

0 commit comments

Comments
 (0)