#!/bin/env bash
DBNAME=$1
DBUSER=$2
DBPASS=$3
DBHOST=$4

source ./build_bokeh_config.sh $DBNAME $DBUSER $DBPASS $DBHOST

EARLY_DESC=`php -r "echo version_compare(PHP_VERSION, '8.1', '>=') ? '--fail-error-with-desc' : '';"`

phpunit -c tests/phpunit_eco.xml --list-suites $EARLY_DESC \
    && phpunit -c tests/phpunit_eco.xml $EARLY_DESC \
    && phpunit -c tests/phpunit_db.xml --list-suites $EARLY_DESC \
    && phpunit -c tests/phpunit_db.xml --exclude-group no-ci $EARLY_DESC \
    && cd cosmogramme/tests \
    && phpunit --list-suites $EARLY_DESC \
    && phpunit --exclude-group no-ci $EARLY_DESC \
    && cd ../cosmozend/tests \
    && phpunit --list-suites $EARLY_DESC \
    && phpunit --exclude-group no-ci $EARLY_DESC
