#!/bin/bash
set -e

BASH_XTRACEFD=1
set -x

patch -p1 < debian/patches/DEP-8/Tests-against-installed-classes.patch
mkdir --parents vendor
phpab \
	--output vendor/autoload.php \
	--basedir vendor \
	--template debian/autoload.ci.php.tpl \
	--whitelist 'symfony\\*' \
	src/Symfony/*/*/Tests \
	src/Symfony/*/*/*/Tests \
	src/Symfony/*/*/Test
phpunit --exclude-group online,tty,benchmark,intl-data && exit_code=0 || exit_code=$?
patch -Rp1 < debian/patches/DEP-8/Tests-against-installed-classes.patch
exit $exit_code
