summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-11-10 11:04:37 +0100
committerRemi Collet <remi@remirepo.net>2017-11-10 11:04:37 +0100
commita95b69259b711355044f485c5c936e5ae4eb17d4 (patch)
treee5a6573386434e6c51f819bcce3b4ea6d7a55797
parent83ac416483d249029bff10387d154d7748d3eafa (diff)
Update to 1.7.1
fix erratic FTBFS from Koschei skip 1 test on BigEndian https://github.com/fzaninotto/Faker/issues/1346 ignore test results on 32-bit https://github.com/fzaninotto/Faker/issues/1347
-rw-r--r--.gitignore8
-rw-r--r--composer.json8
-rw-r--r--php-Faker-upstream.patch57
-rw-r--r--php-Faker.spec62
4 files changed, 47 insertions, 88 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fc9aa8c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+clog
+package-*.xml
+*.tgz
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/composer.json b/composer.json
index 1bf3497..d3bfd6c 100644
--- a/composer.json
+++ b/composer.json
@@ -10,11 +10,11 @@
}
],
"require": {
- "php": "^5.3.3|^7.0"
+ "php": "^5.3.3 || ^7.0"
},
"require-dev": {
- "phpunit/phpunit": "~4.0",
- "squizlabs/php_codesniffer": "~1.5",
+ "phpunit/phpunit": "^4.0 || ^5.0",
+ "squizlabs/php_codesniffer": "^1.5",
"ext-intl": "*"
},
"autoload": {
@@ -29,7 +29,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "1.6.0"
+ "dev-master": "1.8-dev"
}
}
}
diff --git a/php-Faker-upstream.patch b/php-Faker-upstream.patch
deleted file mode 100644
index bda2a97..0000000
--- a/php-Faker-upstream.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 19dcb9039ec3df9776af23aebd9de5c8d0de3946 Mon Sep 17 00:00:00 2001
-From: oittaa <oittaa@users.noreply.github.com>
-Date: Thu, 6 Oct 2016 23:59:25 +0300
-Subject: [PATCH] [UuidTest.php] Don't use mt_srand() directly.
-
----
- test/Faker/Provider/UuidTest.php | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/test/Faker/Provider/UuidTest.php b/test/Faker/Provider/UuidTest.php
-index fceb8df..22f9efb 100644
---- a/test/Faker/Provider/UuidTest.php
-+++ b/test/Faker/Provider/UuidTest.php
-@@ -2,6 +2,7 @@
-
- namespace Faker\Test\Provider;
-
-+use Faker\Generator;
- use Faker\Provider\Uuid as BaseProvider;
-
- class UuidTest extends \PHPUnit_Framework_TestCase
-@@ -14,7 +15,8 @@ public function testUuidReturnsUuid()
-
- public function testUuidExpectedSeed()
- {
-- mt_srand(123);
-+ $faker = new Generator();
-+ $faker->seed(123);
- $this->assertEquals("8e2e0c84-50dd-367c-9e66-f3ab455c78d6", BaseProvider::uuid());
- $this->assertEquals("073eb60a-902c-30ab-93d0-a94db371f6c8", BaseProvider::uuid());
- }
-From 89135d0fe594ec7f3e82ef084242df09b88f6fd8 Mon Sep 17 00:00:00 2001
-From: oittaa <oittaa@users.noreply.github.com>
-Date: Thu, 6 Oct 2016 23:32:59 +0300
-Subject: [PATCH] [Generator.php] mt_rand() changed in PHP 7.1
-
----
- src/Faker/Generator.php | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/src/Faker/Generator.php b/src/Faker/Generator.php
-index cb13cd0..9496bca 100644
---- a/src/Faker/Generator.php
-+++ b/src/Faker/Generator.php
-@@ -188,7 +188,11 @@ public function seed($seed = null)
- if ($seed === null) {
- mt_srand();
- } else {
-- mt_srand((int) $seed);
-+ if (PHP_VERSION_ID < 70100) {
-+ mt_srand((int) $seed);
-+ } else {
-+ mt_srand((int) $seed, MT_RAND_PHP);
-+ }
- }
- }
-
diff --git a/php-Faker.spec b/php-Faker.spec
index e7726f6..3c8f650 100644
--- a/php-Faker.spec
+++ b/php-Faker.spec
@@ -12,8 +12,8 @@
%global github_owner fzaninotto
%global github_name Faker
-%global github_version 1.6.0
-%global github_commit 44f9a286a04b80c76a4e5fb7aad8bb539b920123
+%global github_version 1.7.1
+%global github_commit d3ed4cc37051c1ca52d22d76b437d14809fc7e0d
%global composer_vendor fzaninotto
%global composer_project faker
@@ -28,7 +28,7 @@
Name: php-%{github_name}
Version: %{github_version}
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A PHP library that generates fake data
Group: Development/Libraries
@@ -36,10 +36,10 @@ License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
-# For PHP 7.1
-Patch0: %{name}-upstream.patch
-
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+# remirepo:3
+# For test build on all available arch
+#global debug_package %{nil}
+#global __debug_install_post /bin/true
BuildArch: noarch
# Tests
%if %{with_tests}
@@ -101,9 +101,13 @@ Optional:
%prep
%setup -qn %{github_name}-%{github_commit}
-%patch0 -p1 -b .upstream
-find src -name \*upstream -exec rm {} \;
+%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
: Create autoloader
cat <<'AUTOLOAD' | tee src/Faker/autoload.php
@@ -126,12 +130,12 @@ AUTOLOAD
%install
-rm -rf %{buildroot}
mkdir -p %{buildroot}%{phpdir}
cp -rp src/%{github_name} %{buildroot}%{phpdir}/
%check
+%if %{with_tests}
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
@@ -139,35 +143,28 @@ require_once '%{buildroot}%{phpdir}/Faker/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('Faker\\Test\\', dirname(__DIR__).'/test/Faker');
EOF
-%if %{with_tests}
-: Skip tests that require downloading content
-sed -e 's/function testDownloadWithDefaults/function SKIP_testDownloadWithDefaults/' \
- -i test/Faker/Provider/ImageTest.php
-: Skip bad test see https://github.com/fzaninotto/Faker/issues/1146
-sed -e 's/func testIpv4NotLocalNetwork/func SKIP_testIpv4NotLocalNetwork/' \
- -i test/Faker/Provider/InternetTest.php
-: Skip tests with erratic results in Koschei
-#sed -e '/561059108101825/d' \
-# -e '/601100099013942/d' \
-# -i test/Faker/Calculator/LuhnTest.php
+%ifarch ppc64 s390x
+# see https://github.com/fzaninotto/Faker/issues/1346
+rm -f test/Faker/Provider/UuidTest.php
+%endif
ret=0
-for cmd in php56 php70 php71 php; do
+for cmd in php php56 php70 php71 php72; do
if which $cmd; then
$cmd %{_bindir}/phpunit --verbose || ret=1
fi
done
-exit $ret
+if [ $(php -r 'echo PHP_INT_SIZE;') -lt 8 ]; then
+ : ignore test suite results https://github.com/fzaninotto/Faker/issues/1347
+else
+ exit $ret
+fi
%else
: Tests skipped
%endif
-%clean
-rm -rf %{buildroot}
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
@@ -176,6 +173,17 @@ rm -rf %{buildroot}
%changelog
+* Fri Nov 10 2017 Remi Collet <remi@remirepo.net> - 1.7.1-2
+- fix skip result condition
+
+* Fri Nov 10 2017 Remi Collet <remi@remirepo.net> - 1.7.1-1
+- Update to 1.7.1
+- fix erratic FTBFS from Koschei
+- skip 1 test on BigEndian
+ https://github.com/fzaninotto/Faker/issues/1346
+- ignore test results on 32-bit
+ https://github.com/fzaninotto/Faker/issues/1347
+
* Thu Feb 16 2017 Remi Collet <remi@remirepo.net> - 1.6.0-1
- update to 1.6.0
- switch to fedora/autoloader