diff --git a/.gitignore b/.gitignore index 5b3fb9e..069d5fa 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ clog /php-Faker-1.7.1-d3ed4cc37051c1ca52d22d76b437d14809fc7e0d.tar.gz /php-Faker-1.8.0-f72816b43e74063c8b10357394b6bba8cb1c10de.tar.gz /php-Faker-1.9.0-27a216cbe72327b2d6369fab721a5843be71e57d.tar.gz +/php-Faker-1.9.2-848d8125239d7dbf8ab25cb7f054f1a630e68c2e.tar.gz diff --git a/php-Faker-php8.patch b/php-Faker-php8.patch new file mode 100644 index 0000000..7c591a0 --- /dev/null +++ b/php-Faker-php8.patch @@ -0,0 +1,51 @@ +From c351d8ff9cf1962b1f16d4d4a148722411c86956 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 26 Mar 2021 15:48:03 +0100 +Subject: [PATCH 1/2] fix Deprecated: Required parameter $isInFuture follows + optional parameter $interval + +--- + test/Faker/Provider/DateTimeTest.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/Faker/Provider/DateTimeTest.php b/test/Faker/Provider/DateTimeTest.php +index 30386f3c..da72984e 100644 +--- a/test/Faker/Provider/DateTimeTest.php ++++ b/test/Faker/Provider/DateTimeTest.php +@@ -209,7 +209,7 @@ final class DateTimeTest extends TestCase + * + * @dataProvider providerDateTimeInInterval + */ +- public function testDateTimeInInterval($start, $interval = "+5 days", $isInFuture) ++ public function testDateTimeInInterval($start, $interval, $isInFuture) + { + $date = DateTimeProvider::dateTimeInInterval($start, $interval); + $this->assertInstanceOf('\DateTime', $date); +-- +2.30.2 + +From e9b8e6e9304333d8d578b06766c4d36b82a04428 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 26 Mar 2021 15:49:50 +0100 +Subject: [PATCH 2/2] fix tests expectation + +--- + test/Faker/Provider/TextTest.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/Faker/Provider/TextTest.php b/test/Faker/Provider/TextTest.php +index b817b6d4..aa7bd2da 100644 +--- a/test/Faker/Provider/TextTest.php ++++ b/test/Faker/Provider/TextTest.php +@@ -37,7 +37,7 @@ final class TextTest extends TestCase + */ + public function testTextMaxLength($length) + { +- $this->assertLessThan($length, $this->generator->realText($length)); ++ $this->assertLessThan($length, strlen($this->generator->realText($length))); + } + + public function testTextMaxIndex() +-- +2.30.2 + diff --git a/php-Faker.spec b/php-Faker.spec index bdfed9a..0b8074f 100644 --- a/php-Faker.spec +++ b/php-Faker.spec @@ -1,7 +1,7 @@ # # Fedora spec file for php-Faker # -# Copyright (c) 2012-2019 Shawn Iwinski +# Copyright (c) 2012-2021 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -11,8 +11,8 @@ %global github_owner fzaninotto %global github_name Faker -%global github_version 1.9.0 -%global github_commit 27a216cbe72327b2d6369fab721a5843be71e57d +%global github_version 1.9.2 +%global github_commit 848d8125239d7dbf8ab25cb7f054f1a630e68c2e %global composer_vendor fzaninotto %global composer_project faker @@ -27,7 +27,7 @@ Name: php-%{github_name} Version: %{github_version} -Release: 4%{?dist} +Release: 1%{?dist} Summary: A PHP library that generates fake data License: MIT @@ -38,6 +38,9 @@ URL: https://github.com/%{github_owner}/%{github_name} Source0: %{name}-%{github_version}-%{github_commit}.tar.gz Source1: %{name}-get-source.sh +# For PHP 8, not submitted upstream as dead project +Patch0: %{name}-php8.patch + BuildArch: noarch # Tests %if %{with_tests} @@ -103,13 +106,7 @@ Optional: %prep %setup -qn %{github_name}-%{github_commit} - -%if 0%{?el6} -# For old PHPUnit -for test in $(find test -name \*Test.php); do - sed -e '/assertNotFalse/s/);/, false);/;s/assertNotFalse/assertNotSame/' -i $test -done -%endif +%patch0 -p1 -b .php8 : Create autoloader cat <<'AUTOLOAD' | tee src/Faker/autoload.php @@ -153,7 +150,7 @@ sed 's/function testFixedSeedWithMaximumTimestamp/function SKIP_testFixedSeedWit -i test/Faker/Provider/DateTimeTest.php ret=0 -for cmd in php php56 php70 php71 php72 php73 php74; do +for cmd in php php73 php74 php80; do if which $cmd; then $cmd -d memory_limit=1G %{_bindir}/phpunit --verbose || ret=1 fi @@ -173,6 +170,10 @@ exit $ret %changelog +* Fri Mar 26 2021 Remi Collet - 1.9.2-1 +- update to 1.9.2 +- add minimal test for PHP 8 + * Wed Jan 27 2021 Fedora Release Engineering - 1.9.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/sources b/sources index 51b0e77..41665c4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (php-Faker-1.9.0-27a216cbe72327b2d6369fab721a5843be71e57d.tar.gz) = 1ae6f4b8a5fbd1a20463a13a9cba9933063930e1b36e35a0db76207b927958f86dab6b2a55c2d9b148094a5febaa440bbcf3161ae0317d5ba410d2a987503f34 +SHA512 (php-Faker-1.9.2-848d8125239d7dbf8ab25cb7f054f1a630e68c2e.tar.gz) = 0ed95f06a0bc2d39b29893f7b6d8d41676dfafc89418adb3bfa9ba464bc508d7b99a1bcc1e1620867b03e537c08c70246c4b9259270676cf4a13f4f56b1c6ce6