diff options
| -rw-r--r-- | php-theseer-directoryscanner-tests.patch | 68 | ||||
| -rw-r--r-- | php-theseer-directoryscanner.spec | 43 |
2 files changed, 98 insertions, 13 deletions
diff --git a/php-theseer-directoryscanner-tests.patch b/php-theseer-directoryscanner-tests.patch new file mode 100644 index 0000000..a0bfe98 --- /dev/null +++ b/php-theseer-directoryscanner-tests.patch @@ -0,0 +1,68 @@ +diff --git a/tests/directoryscanner.test.php b/tests/directoryscanner.test.php +index 403aa06..17141dc 100644 +--- a/tests/directoryscanner.test.php ++++ b/tests/directoryscanner.test.php +@@ -45,7 +45,7 @@ namespace TheSeer\DirectoryScanner\Tests { + * @author Arne Blankerts <arne@blankerts.de> + * @copyright Arne Blankerts <arne@blankerts.de>, All rights reserved. + */ +- class DirectoryScannerTest extends \PHPUnit_Framework_TestCase { ++ class DirectoryScannerTest extends \PHPUnit\Framework\TestCase { + + /** + * Test if enabling following symbolic links works. +@@ -60,19 +60,19 @@ namespace TheSeer\DirectoryScanner\Tests { + } + + /** +- * @expectedException \TheSeer\DirectoryScanner\Exception +- * @expectedExceptionCode \TheSeer\DirectoryScanner\Exception::InvalidFlag + */ + public function testSettingInvalidFlagThrowsException() { ++ $this->expectException(\TheSeer\DirectoryScanner\Exception::class); ++ $this->expectExceptionCode(\TheSeer\DirectoryScanner\Exception::InvalidFlag); + $tmp = new DirectoryScanner(); + $tmp->setFlag(-1); + } + + /** +- * @expectedException \TheSeer\DirectoryScanner\Exception +- * @expectedExceptionCode \TheSeer\DirectoryScanner\Exception::InvalidFlag + */ + public function testUnSettingInvalidFlagThrowsException() { ++ $this->expectException(\TheSeer\DirectoryScanner\Exception::class); ++ $this->expectExceptionCode(\TheSeer\DirectoryScanner\Exception::InvalidFlag); + $tmp = new DirectoryScanner(); + $tmp->unsetFlag(-1); + } +@@ -127,9 +127,9 @@ namespace TheSeer\DirectoryScanner\Tests { + /** + * Trying to scan a non existend directory should throw an exception + * +- * @expectedException \TheSeer\DirectoryScanner\Exception + */ + public function testScanOfNonExistendPath() { ++ $this->expectException(\TheSeer\DirectoryScanner\Exception::class); + $tmp = new DirectoryScanner(); + $tmp(__DIR__ . '/_data//not/existing'); + } +diff --git a/tests/phpfilter.test.php b/tests/phpfilter.test.php +index fc518c6..d800b8f 100644 +--- a/tests/phpfilter.test.php ++++ b/tests/phpfilter.test.php +@@ -43,7 +43,7 @@ namespace TheSeer\DirectoryScanner\Tests { + * @author Arne Blankerts <arne@blankerts.de> + * @copyright Arne Blankerts <arne@blankerts.de>, All rights reserved. + */ +- class PHPFilterIteratorTest extends \PHPUnit_Framework_TestCase { ++ class PHPFilterIteratorTest extends \PHPUnit\Framework\TestCase { + + public function testNonPHPFile() { + $list = new \ArrayIterator( +@@ -81,4 +81,4 @@ namespace TheSeer\DirectoryScanner\Tests { + + } + +-} +\ No newline at end of file ++} diff --git a/php-theseer-directoryscanner.spec b/php-theseer-directoryscanner.spec index 4eaf27c..442df4f 100644 --- a/php-theseer-directoryscanner.spec +++ b/php-theseer-directoryscanner.spec @@ -1,8 +1,8 @@ # spec file for php-theseer-directoryscanner # -# Copyright (c) 2014-2021 Remi Collet -# License: CC-BY-SA -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2014-2025 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # @@ -22,25 +22,26 @@ Name: php-theseer-directoryscanner Version: 1.3.3 -Release: 2%{?dist} +Release: 11%{?dist} Summary: A recursive directory scanner and filter -Group: Development/Libraries -License: BSD +License: BSD-2-Clause URL: https://github.com/%{gh_owner}/%{gh_project} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}.tar.gz +# minimal fix to allow phpunit9 +Patch0: %{name}-tests.patch + BuildArch: noarch BuildRequires: php(language) >= 5.3.1 %if %{with tests} -BuildRequires: %{_bindir}/phpunit +BuildRequires: phpunit9 %endif # From composer.json Requires: php(language) >= 5.3.1 # From phpcompatinfo report for 1.3.0 Requires: php-fileinfo -Requires: php-spl Provides: php-composer(theseer/directoryscanner) = %{version} Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version} @@ -52,6 +53,7 @@ A recursive directory scanner and filter. %prep %setup -q -n %{gh_project}-%{gh_commit} +%patch -P0 -p1 %build @@ -65,13 +67,22 @@ cp -pr src %{buildroot}%{php_home}/%{gh_project} %check %if %{with tests} +cat << 'EOF' | tee bs.php +<?php +require_once '%{buildroot}%{php_home}/%{gh_project}/autoload.php'; +EOF + ret=0 -for cmd in php php74 php80 php81; do +for cmd in php php81 php82 php83 php84; do if which $cmd; then - $cmd %{_bindir}/phpunit \ - --bootstrap %{buildroot}%{php_home}/%{gh_project}/autoload.php \ + $cmd %{_bindir}/phpunit9 \ + --bootstrap bs.php \ --verbose \ - --no-coverage || ret=1 + --no-coverage \ + --do-not-cache-result \ + --test-suffix=.test.php \ + --no-configuration \ + tests || ret=1 fi done exit $ret @@ -86,7 +97,6 @@ fi %files -%{!?_licensedir:%global license %%doc} %license LICENSE %doc composer.json %dir %{php_home} @@ -94,6 +104,13 @@ fi %changelog +* Thu Jun 26 2025 Remi Collet <remi@remirepo.net> - 1.3.3-11 +- use phpunit9 +- re-license spec file to CECILL-2.1 + +* Wed Jan 31 2024 Remi Collet <remi@remirepo.net> - 1.3.3-8 +- use phpunit7 FTBFS #2261513 + * Mon Dec 6 2021 Remi Collet <remi@remirepo.net> - 1.3.3-2 - disable test suite on EL |
