From fd61b2c8f6d5ee3bbfa2016f4da2dbb2f9e28221 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 28 Sep 2020 16:55:44 +0200 Subject: [PATCH] switch to classmap autoloader (cherry picked from commit 982f82b95c73f2869f2f66a72d25c4726c8f2f70) --- php-phpspec-prophecy-autoload.php | 27 --------------------------- php-phpspec-prophecy.spec | 25 ++++++++++++++----------- 2 files changed, 14 insertions(+), 38 deletions(-) delete mode 100644 php-phpspec-prophecy-autoload.php diff --git a/php-phpspec-prophecy-autoload.php b/php-phpspec-prophecy-autoload.php deleted file mode 100644 index dfb7e08..0000000 --- a/php-phpspec-prophecy-autoload.php +++ /dev/null @@ -1,27 +0,0 @@ -= 7.2 %if %{with tests} @@ -79,11 +76,16 @@ to be used inside any testing framework out there with minimal effort. %prep %setup -q -n %{gh_project}-%{gh_commit} -cp %{SOURCE1} src/Prophecy/autoload.php - %build -# Nothing +phpab --template fedora --output src/Prophecy/autoload.php src +cat << 'EOF' | tee -a src/Prophecy/autoload.php + +\Fedora\Autoloader\Dependencies::required([ + '%{_datadir}/php/phpDocumentor/Reflection/DocBlock5/autoload.php', +]); +/* Comparator and RecursionContext pulled by phpspec or phpunit */ +EOF %install @@ -110,12 +112,10 @@ phpspec --version ret=0 for cmd in php php72 php73 php74; do if which $cmd; then - $cmd -d include_path=.:%{buildroot}%{_datadir}/php:%{_datadir}/php \ - -d auto_prepend_file=vendor/autoload.php \ + $cmd -d auto_prepend_file=vendor/autoload.php \ %{_bindir}/phpspec run --format pretty --verbose --no-ansi || ret=1 - $cmd -d include_path=.:%{buildroot}%{_datadir}/php:%{_datadir}/php \ - -d auto_prepend_file=vendor/autoload.php \ + $cmd -d auto_prepend_file=vendor/autoload.php \ %{_bindir}/phpunit8 || ret=1 fi done @@ -133,6 +133,9 @@ exit $ret %changelog +* Mon Sep 28 2020 Remi Collet - 1.12.0-2 +- switch to classmap autoloader + * Mon Sep 28 2020 Remi Collet - 1.12.0-1 - update to 1.12.0 - raise dependency on phpdocumentor/reflection-docblock 5.2