#!/usr/bin/make -f

%:
	dh $@

override_dh_auto_build:
	# generate static autoloader
	phpab \
		--output src/ReCaptcha/autoload.php \
		src/ReCaptcha

override_dh_auto_test:
	# keep in sync with debian/tests
	# phpunit.xml.dist asks for executionOrder="defects", which PHPUnit 13 cannot
	# honour while the test run history is disabled and reports as a runner
	# warning; the configuration also fails on warnings, so the build failed.
	# A build must not depend on the result of a previous run anyway, so the
	# order is fixed to the default one.
	phpunit --no-coverage --do-not-record-test-run-history --order-by=default --fail-on-empty-test-suite --bootstrap src/ReCaptcha/autoload.php
	phpunit --no-coverage --do-not-record-test-run-history --order-by=default --fail-on-empty-test-suite --display-deprecations --fail-on-deprecation --bootstrap src/ReCaptcha/autoload.php debian/tests/SimpleTest.php
