summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-07-21 18:49:23 +0200
committerRemi Collet <fedora@famillecollet.com>2016-07-21 18:49:23 +0200
commitb75d4bf8b666a0f05ee68ea21ec13633778b2da3 (patch)
tree0fcb7ed09b54ac5956f8a59632ac22b7dce132c6
parent0ce9a149953b469449ba2e19bd1a2a1bc8eb8251 (diff)
: fix FTBFS
-rw-r--r--php-JsonSchema-pr292.patch25
-rw-r--r--php-JsonSchema.spec27
2 files changed, 48 insertions, 4 deletions
diff --git a/php-JsonSchema-pr292.patch b/php-JsonSchema-pr292.patch
new file mode 100644
index 0000000..cb539af
--- /dev/null
+++ b/php-JsonSchema-pr292.patch
@@ -0,0 +1,25 @@
+Adapted from v1.6.1 from:
+
+
+From 14c9472c2ba0c8fdd5d99dc634f4db976d51237f Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Thu, 21 Jul 2016 18:37:10 +0200
+Subject: [PATCH] Fix #291 failed tests with lestest PHP
+
+Since 5.6.24, 7.0.9, 7.1.0beta1, negative timestamps are valid.
+---
+ tests/Constraints/FormatTest.php | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/tests/Constraints/FormatTest.php b/tests/Constraints/FormatTest.php
+index f604c08..3ffe5b1 100644
+--- a/tests/JsonSchema/Tests/Constraints/FormatTest.php
++++ b/tests/JsonSchema/Tests/Constraints/FormatTest.php
+@@ -141,7 +141,6 @@ class FormatTest extends BaseTestCase
+ array('1999-01-11T00:00:00+100', 'date-time'),
+ array('1999-01-11T00:00:00+1:00', 'date-time'),
+
+- array('-1', 'utc-millisec'),
+ array(PHP_INT_MAX, 'utc-millisec'),
+
+ array('grey', 'color'),
diff --git a/php-JsonSchema.spec b/php-JsonSchema.spec
index 8e65cbf..3cdbe43 100644
--- a/php-JsonSchema.spec
+++ b/php-JsonSchema.spec
@@ -29,7 +29,7 @@
Name: php-%{lib_name}
Version: %{github_version}
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: PHP implementation of JSON schema
Group: Development/Libraries
@@ -42,6 +42,9 @@ Source1: %{name}-autoload.php
# Script to pull the git snapshot
Source2: %{name}-makesrc.sh
+# https://github.com/justinrainbow/json-schema/pull/292
+Patch0: %{name}-pr292.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
%if %{with_tests}
@@ -95,6 +98,7 @@ See http://json-schema.org for more details.
%prep
%setup -qn %{github_name}-%{github_commit}
+%patch0 -p1
cp -p %{SOURCE1} src/%{lib_name}/autoload.php
@@ -126,11 +130,22 @@ require '%{buildroot}%{phpdir}/%{lib_name}/autoload.php';
$fedoraClassLoader->addPrefix('%{lib_name}\\Tests\\', realpath(__DIR__.'/../tests'));
EOF
+# remirepo:11
+run=0
+ret=0
+if which php56; then
+ php56 %{_bindir}/phpunit || ret=1
+ run=1
+fi
+if which php71; then
+ php71 %{_bindir}/phpunit || ret=1
+ run=1
+fi
+if [ $run -eq 0 ]; then
%{_bindir}/phpunit --verbose
-
-if which php70; then
- php70 %{_bindir}/phpunit --verbose
+# remirepo:2
fi
+exit $ret
%else
: Tests skipped
%endif
@@ -148,6 +163,10 @@ fi
%changelog
+* Thu Jul 21 2016 Remi Collet <remi@fedoraproject.org> - 1.6.1-4
+- fix failed test, FTBFS detected by Koschei
+ open https://github.com/justinrainbow/json-schema/pull/292
+
* Wed Jun 1 2016 Remi Collet <remi@fedoraproject.org> - 1.6.1-3
- drop the validate-json command, moved in php-justinrainbow-json-schema