diff options
author | Remi Collet <fedora@famillecollet.com> | 2013-01-16 09:08:29 +0100 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2013-01-16 09:08:29 +0100 |
commit | fbd4529d484677263e34497e1528ef1297aa8b38 (patch) | |
tree | 63050a9d5fbb11be4332605bfd832687285a6044 | |
parent | 024a7759355a7b5c910a646b5953a14cef138b67 (diff) |
php-horde-Horde-Share: fix tests + cleanups for review
-rw-r--r-- | Horde_Share-tests.patch | 76 | ||||
-rw-r--r-- | php-horde-Horde-Share.spec | 44 |
2 files changed, 101 insertions, 19 deletions
diff --git a/Horde_Share-tests.patch b/Horde_Share-tests.patch new file mode 100644 index 0000000..a596706 --- /dev/null +++ b/Horde_Share-tests.patch @@ -0,0 +1,76 @@ +From eefe220034aeb37c9b755e6ac262887b4c92040c Mon Sep 17 00:00:00 2001 +From: Remi Collet <fedora@famillecollet.com> +Date: Wed, 16 Jan 2013 08:50:19 +0100 +Subject: [PATCH] Fix Horde_Share: test fails (Bug #11966) + +Rename Horde_Share_Test_Base::callback() to callbackSetShareOb() +Avoid name conflict with PHPUnit_Framework_Assert::callback() +--- + framework/Share/test/Horde/Share/Base.php | 2 +- + framework/Share/test/Horde/Share/Kolab/MockTest.php | 4 ++-- + framework/Share/test/Horde/Share/Sql/Base.php | 2 +- + framework/Share/test/Horde/Share/Sqlng/Base.php | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/framework/Share/test/Horde/Share/Base.php b/framework/Share/test/Horde/Share/Base.php +index d2fb25c..1df3be6 100644 +--- a/framework/Share/test/Horde/Share/Base.php ++++ b/framework/Share/test/Horde/Share/Base.php +@@ -585,7 +585,7 @@ public function renameShare() + $this->assertArrayHasKey('joeshare', self::$share->listAllShares()); + } + +- public function callback($share) ++ public function callbackSetShareOb($share) + { + $share->setShareOb(new Horde_Support_Stub()); + $this->assertEquals($share, unserialize(serialize($share))); +diff --git a/framework/Share/test/Horde/Share/Kolab/MockTest.php b/framework/Share/test/Horde/Share/Kolab/MockTest.php +index b56f747..88c1f78 100644 +--- a/framework/Share/test/Horde/Share/Kolab/MockTest.php ++++ b/framework/Share/test/Horde/Share/Kolab/MockTest.php +@@ -231,7 +231,7 @@ public function testRemoveShare() + + public function testCallback() + { +- $this->callback(new Horde_Share_Object_Sql(array())); ++ $this->callbackSetShareOb(new Horde_Share_Object_Sql(array())); + } + + protected function switchAuth($user) +@@ -251,4 +251,4 @@ protected function getCache() + + - Check extra API calls in SQL driver + - add server test +-*/ +\ No newline at end of file ++*/ +diff --git a/framework/Share/test/Horde/Share/Sql/Base.php b/framework/Share/test/Horde/Share/Sql/Base.php +index 1b0fc3e..417a43e 100644 +--- a/framework/Share/test/Horde/Share/Sql/Base.php ++++ b/framework/Share/test/Horde/Share/Sql/Base.php +@@ -184,7 +184,7 @@ public function testRenameShare() + + public function testCallback() + { +- $this->callback(new Horde_Share_Object_Sql(array())); ++ $this->callbackSetShareOb(new Horde_Share_Object_Sql(array())); + } + + public static function setUpBeforeClass() +diff --git a/framework/Share/test/Horde/Share/Sqlng/Base.php b/framework/Share/test/Horde/Share/Sqlng/Base.php +index f658fc5..a10fc9d 100644 +--- a/framework/Share/test/Horde/Share/Sqlng/Base.php ++++ b/framework/Share/test/Horde/Share/Sqlng/Base.php +@@ -185,7 +185,7 @@ public function testRenameShare() + + public function testCallback() + { +- parent::callback(new Horde_Share_Object_Sqlng(array())); ++ $this->callbackSetShareOb(new Horde_Share_Object_Sqlng(array())); + } + + public static function setUpBeforeClass() +-- +1.7.10 + diff --git a/php-horde-Horde-Share.spec b/php-horde-Horde-Share.spec index de7e08f..a36a2c0 100644 --- a/php-horde-Horde-Share.spec +++ b/php-horde-Horde-Share.spec @@ -3,13 +3,9 @@ %global pear_name Horde_Share %global pear_channel pear.horde.org -# not ready -# Fatal error: Cannot make static method PHPUnit_Framework_Assert::callback() non static in class Horde_Share_Test_Base -%global with_tests %{?_with_tests:1}%{!?_with_tests:0} - Name: php-horde-Horde-Share Version: 2.0.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Horde Shared Permissions System Group: Development/Libraries @@ -17,19 +13,25 @@ License: LGPLv2 URL: http://pear.horde.org Source0: http://%{pear_channel}/get/%{pear_name}-%{version}.tgz +# http://bugs.horde.org/ticket/11966 +# https://github.com/horde/horde/pull/28 +Patch0: %{pear_name}-tests.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch +BuildRequires: php-common >= 5.3.0 BuildRequires: php-pear(PEAR) >= 1.7.0 BuildRequires: php-channel(%{pear_channel}) BuildRequires: gettext -%if %{with_tests} # To run unit tests BuildRequires: php-pear(%{pear_channel}/Horde_Test) >= 2.1.0 -%endif +BuildRequires: php-pear(%{pear_channel}/Horde_Group) >= 2.0.0 +BuildRequires: php-pear(%{pear_channel}/Horde_Perms) >= 2.0.0 +BuildRequires: php-pear(%{pear_channel}/Horde_Injector) >= 2.0.0 Requires(post): %{__pear} Requires(postun): %{__pear} -Requires: php(language) >= 5.3.0 +Requires: php-common >= 5.3.0 Requires: php-spl Requires: php-pear(PEAR) >= 1.7.0 Requires: php-channel(%{pear_channel}) @@ -62,11 +64,15 @@ owns or has access to. %setup -q -c cd %{pear_name}-%{version} +%patch0 -p 3 -b .orig + # Don't install .po and .pot files # Remove checksum for .mo, as we regenerate them +# Remove checksum for patched files sed -e '/%{pear_name}.po/d' \ -e '/Horde_Other.po/d' \ -e '/%{pear_name}.mo/s/md5sum=.*name=/name=/' \ + -e '/test/s/md5sum=.*name=/name=/' \ ../package.xml >%{name}.xml @@ -101,15 +107,12 @@ done | tee ../%{pear_name}.lang %check -%if %{with_tests} +src=$(pwd)/%{pear_name}-%{version} cd %{pear_name}-%{version}/test/$(echo %{pear_name} | sed -e s:_:/:g) phpunit \ - -d date.timezone=UTC \ - -d include_path=%{buildroot}%{pear_phpdir}:.:%{pear_phpdir} \ - . -%else -: Test disabled, missing '--with tests' option. -%endif + -d include_path=$src/lib:.:%{pear_phpdir} \ + -d date.timezone=UTC \ + . %post @@ -134,14 +137,17 @@ fi %changelog -* Thu Jan 10 2013 Remi Collet <RPMS@FamilleCollet.com> - 2.0.2-1 +* Wed Jan 16 2013 Remi Collet <remi@fedoraproject.org> - 2.0.2-2 +- add patch for http://bugs.horde.org/ticket/11966 +- always run tests + +* Thu Jan 10 2013 Remi Collet <remi@fedoraproject.org> - 2.0.2-1 - Update to 2.0.2 for remi repo - use local script instead of find_lang - add option for test (need investigation) -* Wed Nov 7 2012 Remi Collet <RPMS@FamilleCollet.com> - 2.0.1-1 +* Wed Nov 7 2012 Remi Collet <remi@fedoraproject.org> - 2.0.1-1 - Update to 2.0.1 for remi repo -* Sat Nov 3 2012 Remi Collet <RPMS@FamilleCollet.com> - 2.0.0-1 +* Sat Nov 3 2012 Remi Collet <remi@fedoraproject.org> - 2.0.0-1 - Initial package - |