diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-01-14 15:01:28 +0100 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-01-14 15:01:28 +0100 |
commit | 2f7717c30224040d22664618cc90133c5d31f537 (patch) | |
tree | 1f961e319afd426742d3f577fd4a9deeebb76657 | |
parent | 383987d74dcf03e1557f2efa9129a5a3f5c4d832 (diff) |
php-ircmaxell-security-lib: fix for tests
-rw-r--r-- | php-ircmaxell-security-lib-upstream.patch | 50 | ||||
-rw-r--r-- | php-ircmaxell-security-lib.spec | 16 |
2 files changed, 61 insertions, 5 deletions
diff --git a/php-ircmaxell-security-lib-upstream.patch b/php-ircmaxell-security-lib-upstream.patch new file mode 100644 index 0000000..24be37b --- /dev/null +++ b/php-ircmaxell-security-lib-upstream.patch @@ -0,0 +1,50 @@ +From ab570b4575eb922c676b6cb40a87b34c7c026c0e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?David=20Pr=C3=A9vot?= <david@tilapin.org> +Date: Sat, 20 Jun 2015 18:46:24 -0400 +Subject: [PATCH] Fix comment + +--- + test/Unit/Core/BigMath/GMPTest.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/Unit/Core/BigMath/GMPTest.php b/test/Unit/Core/BigMath/GMPTest.php +index 560e4bc..25ff8db 100644 +--- a/test/Unit/Core/BigMath/GMPTest.php ++++ b/test/Unit/Core/BigMath/GMPTest.php +@@ -8,7 +8,7 @@ class Unit_Core_BigMath_GMPTest extends Unit_Core_BigMathTest { + + protected function setUp() { + if (!extension_loaded('gmp')) { +- $this->markTestSkipped('BCMath is not loaded'); ++ $this->markTestSkipped('GMP is not loaded'); + } + } + +From 1a4a660ed13183463eb1eecf0fe9e10226713ba1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?David=20Pr=C3=A9vot?= <david@tilapin.org> +Date: Sat, 20 Jun 2015 18:57:10 -0400 +Subject: [PATCH] Fix prioritization of GMP in tests + +This is a follow up of 3a5ba9e4fc4f1b425956b4388ca11262aadbd9c0. +--- + test/Unit/Core/BigMathTest.php | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/test/Unit/Core/BigMathTest.php b/test/Unit/Core/BigMathTest.php +index c2750d1..4155c21 100644 +--- a/test/Unit/Core/BigMathTest.php ++++ b/test/Unit/Core/BigMathTest.php +@@ -35,10 +35,10 @@ public static function provideSubtractTest() { + + public function testCreateFromServerConfiguration() { + $instance = \SecurityLib\BigMath::createFromServerConfiguration(); +- if (extension_loaded('bcmath')) { +- $this->assertEquals('SecurityLib\\BigMath\\BCMath', get_class($instance)); +- } elseif (extension_loaded('gmp')) { ++ if (extension_loaded('gmp')) { + $this->assertEquals('SecurityLib\\BigMath\\GMP', get_class($instance)); ++ } elseif (extension_loaded('bcmath')) { ++ $this->assertEquals('SecurityLib\\BigMath\\BCMath', get_class($instance)); + } else { + $this->assertEquals('SecurityLib\\BigMath\\PHPMath', get_class($instance)); + } diff --git a/php-ircmaxell-security-lib.spec b/php-ircmaxell-security-lib.spec index 176f109..e779532 100644 --- a/php-ircmaxell-security-lib.spec +++ b/php-ircmaxell-security-lib.spec @@ -14,7 +14,7 @@ Name: php-ircmaxell-security-lib Version: 1.1.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A Base Security Library Group: Development/Libraries @@ -22,11 +22,15 @@ License: MIT URL: https://github.com/%{gh_owner}/%{gh_project} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}.tar.gz +# Upstream patches +Patch0: %{name}-upstream.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch %if %{with_tests} BuildRequires: php(language) >= 5.3.2 BuildRequires: php-bcmath +BuildRequires: php-gmp BuildRequires: php-hash BuildRequires: %{_bindir}/phpab BuildRequires: %{_bindir}/phpunit @@ -61,6 +65,7 @@ Autoloader: %{_datadir}/php/SecurityLib/autoload.php %prep %setup -q -n %{gh_project}-%{gh_commit} +%patch0 -p1 rm lib/SecurityLib/composer.json @@ -94,12 +99,10 @@ require_once '%{buildroot}%{_datadir}/php/SecurityLib/autoload.php'; EOF : Run test suite -cat /etc/php.ini /etc/php.d/*ini | grep -v gmp >php.ini -php -n -c $PWD/php.ini %{_bindir}/phpunit --verbose +%{_bindir}/phpunit --verbose if which php70; then - cat /etc/opt/remi/php70/php.ini /etc/opt/remi/php70/php.d/*ini | grep -v gmp >php.ini - php70 -n -c $PWD/php.ini %{_bindir}/phpunit --verbose + php70 %{_bindir}/phpunit --verbose fi %else : Test suite disabled @@ -120,6 +123,9 @@ rm -rf %{buildroot} %changelog +* Thu Jan 14 2016 Remi Collet <remi@fedoraproject.org> - 1.1.0-4 +- add upstream patches to fix test suite + * Thu Jan 14 2016 Remi Collet <remi@fedoraproject.org> - 1.1.0-3 - add autoloader |