#!/usr/bin/env bash

set -ex

launcher=
if command -v catchsegv; then
    launcher=catchsegv
fi

if [ -z $PHP_BINARY ]; then
    PHP_BINARY=$(which php)
fi

if [ ! -d vendor ]; then
    composer update
fi

$launcher $PHP_BINARY -c php.ini vendor/bin/phpunit tests --debug
