diff options
-rw-r--r-- | php-egulias-email-validator2-phpunit.patch | 36 | ||||
-rw-r--r-- | php-egulias-email-validator2.spec | 28 |
2 files changed, 53 insertions, 11 deletions
diff --git a/php-egulias-email-validator2-phpunit.patch b/php-egulias-email-validator2-phpunit.patch new file mode 100644 index 0000000..632042c --- /dev/null +++ b/php-egulias-email-validator2-phpunit.patch @@ -0,0 +1,36 @@ +diff -up ./tests/EmailValidator/Validation/MultipleValidationWithAndTest.php.old ./tests/EmailValidator/Validation/MultipleValidationWithAndTest.php +--- ./tests/EmailValidator/Validation/MultipleValidationWithAndTest.php.old 2020-08-11 11:42:35.142594018 +0200 ++++ ./tests/EmailValidator/Validation/MultipleValidationWithAndTest.php 2020-08-11 11:43:45.452483997 +0200 +@@ -28,11 +28,9 @@ class MultipleValidationWithAndTest exte + $this->assertFalse($multipleValidation->isValid("exmpale@example.com", $lexer)); + } + +- /** +- * @expectedException \Egulias\EmailValidator\Validation\Exception\EmptyValidationList +- */ + public function testEmptyListIsNotAllowed() +- { ++ { ++ $this->expectException(\Egulias\EmailValidator\Validation\Exception\EmptyValidationList::class); + new MultipleValidationWithAnd([]); + } + +diff -up ./tests/EmailValidator/Validation/RFCValidationTest.php.old ./tests/EmailValidator/Validation/RFCValidationTest.php +--- ./tests/EmailValidator/Validation/RFCValidationTest.php.old 2020-08-11 11:41:25.030703727 +0200 ++++ ./tests/EmailValidator/Validation/RFCValidationTest.php 2020-08-11 11:41:32.397692197 +0200 +@@ -49,13 +49,13 @@ class RFCValidationTest extends TestCase + */ + protected $lexer; + +- protected function setUp() ++ protected function setUp(): void + { + $this->validator = new RFCValidation(); + $this->lexer = new EmailLexer(); + } + +- protected function tearDown() ++ protected function tearDown(): void + { + $this->validator = null; + } diff --git a/php-egulias-email-validator2.spec b/php-egulias-email-validator2.spec index a679a10..b9ff491 100644 --- a/php-egulias-email-validator2.spec +++ b/php-egulias-email-validator2.spec @@ -10,8 +10,8 @@ %global github_owner egulias %global github_name EmailValidator -%global github_version 2.1.18 -%global github_commit cfa3d44471c7f5bfb684ac2b0da7114283d78441 +%global github_version 2.1.19 +%global github_commit 840d5603eb84cc81a6a0382adac3293e57c1c64c %global github_short %(c=%{github_commit}; echo ${c:0:7}) %global major 2 @@ -39,6 +39,9 @@ URL: https://github.com/%{github_owner}/%{github_name} Source0: %{name}-%{github_version}-%{github_short}.tgz Source1: makesrc.sh +# adapt for recent PHPUnit +Patch0: %{name}-phpunit.patch + BuildArch: noarch # Tests %if %{with tests} @@ -47,14 +50,15 @@ BuildArch: noarch # "phpunit/phpunit": "^4.8.36|^7.5.15", # "satooshi/php-coveralls": "^1.0.1" # remirepo:1 -%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +%if 0%{?fedora} >= 30 || 0%{?rhel} >= 8 BuildRequires: (php-composer(doctrine/lexer) >= %{doctrine_lexer_min_ver} with php-composer(doctrine/lexer) < %{doctrine_lexer_max_ver}) -# remirepo:3 +%global phpunit %{_bindir}/phpunit9 +# remirepo:4 %else BuildRequires: php-doctrine-lexer >= %{doctrine_lexer_min_ver} +%global phpunit %{_bindir}/phpunit8 %endif -BuildRequires: phpunit7 >= 7.5.15 -%global phpunit %{_bindir}/phpunit6 +BuildRequires: %{phpunit} ## composer.json BuildRequires: php(language) >= %{php_min_ver} ## phpcompatinfo (computed from version 2.1.2) @@ -94,6 +98,7 @@ Autoloader: %{phpdir}/Egulias/EmailValidator%{major}/autoload.php %prep %setup -qn %{github_name}-%{github_commit} +%patch0 -p1 -b .phpunit %build @@ -124,19 +129,16 @@ require_once "%{buildroot}%{phpdir}/Egulias/EmailValidator%{major}/autoload.php" \Fedora\Autoloader\Autoload::addPsr4('Egulias\\Tests\\', dirname(__DIR__) . "/tests"); EOF -# See https://github.com/egulias/EmailValidator/pull/244 -sed -e 's/Tests/tests/' phpunit.xml.dist >phpunit.xml - : Skip online tests rm tests/EmailValidator/Validation/DNSCheckValidationTest.php rm tests/EmailValidator/Validation/SpoofCheckValidationTest.php : Upstream tests ret=0 -for cmdarg in "php %{phpunit}" php72 php73 php74 php80; do +for cmdarg in "php %{phpunit}" "php72 %{_bindir}/phpunit8" php73 php74 php80; do if which $cmdarg; then set $cmdarg - $1 ${2:-%{_bindir}/phpunit7} \ + $1 ${2:-%{_bindir}/phpunit9} \ --verbose || ret=1 fi done @@ -157,6 +159,10 @@ exit $ret %changelog +* Tue Aug 11 2020 Remi Collet <remi@remirepo.net> - 2.1.19-1 +- update to 2.1.19 +- switch to phpunit9 + * Wed Jun 17 2020 Remi Collet <remi@remirepo.net> - 2.1.18-1 - update to 2.1.18 - open https://github.com/egulias/EmailValidator/pull/244 |