summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-02-01 14:08:05 +0100
committerRemi Collet <remi@remirepo.net>2018-02-01 14:08:05 +0100
commit0c80974541a8ca81d2aefd3845517244105ae277 (patch)
treef8f9b024f729f3d7402ae6b49ec04bd1ced07201
parent098fe46b3f41b5547f541d00e1592a966994330e (diff)
Update to 2.6.0
raise dependency on PHP 5.6 switch to phpunit6
-rw-r--r--31.patch67
-rw-r--r--composer.json22
-rw-r--r--php-zendframework-zend-permissions-rbac.spec40
3 files changed, 42 insertions, 87 deletions
diff --git a/31.patch b/31.patch
deleted file mode 100644
index 5bc443a..0000000
--- a/31.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 2cc86d0181dc3d05bbf7d4830a219e7ad5f3f954 Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@remirepo.net>
-Date: Tue, 31 Oct 2017 12:35:53 +0100
-Subject: [PATCH 1/2] Fix test (and count usage with 7.2)
-
----
- test/RbacTest.php | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/test/RbacTest.php b/test/RbacTest.php
-index 1c387e25..5bd364db 100644
---- a/test/RbacTest.php
-+++ b/test/RbacTest.php
-@@ -136,7 +136,8 @@ public function testAddRoleWithParentsUsingRbac()
- $this->rbac->addRole($bar, $foo);
-
- $this->assertEquals($bar->getParent(), $foo);
-- $this->assertEquals(1, count($foo->getChildren()));
-+ $this->assertEquals($foo->getChildren(), $bar);
-+ $this->assertInstanceOf('Zend\Permissions\Rbac\Role', $foo->getChildren());
- }
-
- public function testAddRoleWithAutomaticParentsUsingRbac()
-@@ -148,7 +149,8 @@ public function testAddRoleWithAutomaticParentsUsingRbac()
- $this->rbac->addRole($bar, $foo);
-
- $this->assertEquals($bar->getParent(), $foo);
-- $this->assertEquals(1, count($foo->getChildren()));
-+ $this->assertEquals($foo->getChildren(), $bar);
-+ $this->assertInstanceOf('Zend\Permissions\Rbac\Role', $foo->getChildren());
- }
-
- /**
-
-From 8e8a5ff205c78aaf343355424802da79f07504e3 Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@remirepo.net>
-Date: Tue, 31 Oct 2017 12:42:26 +0100
-Subject: [PATCH 2/2] also check hasChildren
-
----
- test/RbacTest.php | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/test/RbacTest.php b/test/RbacTest.php
-index 5bd364db..2326f109 100644
---- a/test/RbacTest.php
-+++ b/test/RbacTest.php
-@@ -136,7 +136,9 @@ public function testAddRoleWithParentsUsingRbac()
- $this->rbac->addRole($bar, $foo);
-
- $this->assertEquals($bar->getParent(), $foo);
-+ $this->assertTrue($foo->hasChildren());
- $this->assertEquals($foo->getChildren(), $bar);
-+ $this->assertFalse($bar->hasChildren());
- $this->assertInstanceOf('Zend\Permissions\Rbac\Role', $foo->getChildren());
- }
-
-@@ -149,7 +151,9 @@ public function testAddRoleWithAutomaticParentsUsingRbac()
- $this->rbac->addRole($bar, $foo);
-
- $this->assertEquals($bar->getParent(), $foo);
-+ $this->assertTrue($foo->hasChildren());
- $this->assertEquals($foo->getChildren(), $bar);
-+ $this->assertFalse($bar->hasChildren());
- $this->assertInstanceOf('Zend\Permissions\Rbac\Role', $foo->getChildren());
- }
-
diff --git a/composer.json b/composer.json
index 4837780..d9ed34a 100644
--- a/composer.json
+++ b/composer.json
@@ -13,14 +13,14 @@
}
},
"require": {
- "php": ">=5.3.23"
+ "php": "^5.6 || ^7.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"branch-alias": {
- "dev-master": "2.5-dev",
- "dev-develop": "2.6-dev"
+ "dev-master": "2.6-dev",
+ "dev-develop": "2.7-dev"
}
},
"autoload-dev": {
@@ -29,7 +29,17 @@
}
},
"require-dev": {
- "fabpot/php-cs-fixer": "1.7.*",
- "phpunit/PHPUnit": "~4.0"
+ "phpunit/phpunit": "^5.7.15|| ^6.2.1",
+ "zendframework/zend-coding-standard": "~1.0.0"
+ },
+ "scripts": {
+ "check": [
+ "@cs-check",
+ "@test"
+ ],
+ "cs-check": "phpcs",
+ "cs-fix": "phpcbf",
+ "test": "phpunit --colors=always",
+ "test-coverage": "phpunit --colors=always --coverage-clover clover.xml"
}
-} \ No newline at end of file
+}
diff --git a/php-zendframework-zend-permissions-rbac.spec b/php-zendframework-zend-permissions-rbac.spec
index 37d1bb2..de55bb8 100644
--- a/php-zendframework-zend-permissions-rbac.spec
+++ b/php-zendframework-zend-permissions-rbac.spec
@@ -7,7 +7,7 @@
# Please, preserve the changelog entries
#
%global bootstrap 0
-%global gh_commit 4213a4889ae7d7607c7974124965d12d1c395115
+%global gh_commit c10ad55e50f402bf14eb2eb9bc424dd9a44dfc78
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner zendframework
%global gh_project zend-permissions-rbac
@@ -20,8 +20,8 @@
%endif
Name: php-%{gh_owner}-%{gh_project}
-Version: 2.5.1
-Release: 6%{?dist}
+Version: 2.6.0
+Release: 1%{?dist}
Summary: Zend Framework Permissions/%{library} component
Group: Development/Libraries
@@ -30,24 +30,30 @@ URL: https://zendframework.github.io/%{gh_project}/
Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
-Patch0: https://patch-diff.githubusercontent.com/raw/zendframework/zend-permissions-rbac/pull/31.patch
-
BuildArch: noarch
# Tests
%if %{with_tests}
-BuildRequires: php(language) >= 5.3.23
+BuildRequires: php(language) >= 5.6
BuildRequires: php-spl
# From composer, "require-dev": {
-# "fabpot/php-cs-fixer": "1.7.*",
-# "phpunit/PHPUnit": "~4.0"
-BuildRequires: php-composer(phpunit/phpunit) >= 4.0
+# "phpunit/phpunit": "^5.7.15|| ^6.2.1",
+# "zendframework/zend-coding-standard": "~1.0.0"
+# remirepo:1
+%if 0%{?fedora} >= 26
+%global phpunit %{_bindir}/phpunit6
+BuildRequires: phpunit6 >= 6.2.1
+# remirepo:4
+%else
+%global phpunit %{_bindir}/phpunit
+BuildRequires: php-phpunit-PHPUnit >= 5.7.21
+%endif
%endif
# Autoloader
BuildRequires: php-fedora-autoloader-devel
# From composer, "require": {
-# "php": ">=5.3.23"
-Requires: php(language) >= 5.3.23
+# "php": "^5.6 || ^7.0"
+Requires: php(language) >= 5.6
# Autoloader
Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 2.5.1
@@ -67,7 +73,6 @@ Documentation: https://zendframework.github.io/%{gh_project}/
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-%patch0 -p1
mv LICENSE.md LICENSE
@@ -92,9 +97,11 @@ require_once '%{buildroot}%{php_home}/Zend/Permissions/%{library}/autoload.php';
EOF
ret=0
-for cmd in php php56 php70 php71 php72; do
+for cmd in "php %{phpunit}" php70 php71 php72; do
if which $cmd; then
- $cmd %{_bindir}/phpunit || ret=1
+ set $cmd
+ $1 ${2:-%{_bindir}/phpunit6} \
+ --verbose || ret=1
fi
done
exit $ret
@@ -114,6 +121,11 @@ exit $ret
%changelog
+* Thu Feb 1 2018 Remi Collet <remi@remirepo.net> - 2.6.0-1
+- Update to 2.6.0
+- raise dependency on PHP 5.6
+- switch to phpunit6
+
* Mon Dec 11 2017 Remi Collet <remi@remirepo.net> - 2.5.1-6
- switch from zend-loader to fedora/autoloader