#!/bin/sh

set +x

# generate outoload-files. keep in sync with debian/rules::override_dh_auto_build
phpab --template debian/autoload-test.php.tpl \
  --output tests/autoload.php \
  tests

# keep in sync with debian/rules::override_dh_auto_test
find tests/ -type f -print0 | xargs -0 sed -i 's/function setUp()/function setUp(): void/g'
find tests/ -type f -print0 | xargs -0 sed -i 's/function tearDown()/function tearDown(): void/g'
phpunit --no-coverage --bootstrap tests/autoload.php
find tests/ -type f -print0 | xargs -0 sed -i 's/function setUp(): void/function setUp()/g'
find tests/ -type f -print0 | xargs -0 sed -i 's/function tearDown(): void/function tearDown()/g'
