From 00a97b6dc7c70fb8bf1ca3f69d0607f02d7356e0 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 31 Oct 2017 13:01:54 +0100 Subject: fix FTBFS from Koschei, add patch for tests with PHP 7.2 https://github.com/zendframework/zend-permissions-rbac/pull/31 --- 31.patch | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 31.patch (limited to '31.patch') diff --git a/31.patch b/31.patch new file mode 100644 index 0000000..5bc443a --- /dev/null +++ b/31.patch @@ -0,0 +1,67 @@ +From 2cc86d0181dc3d05bbf7d4830a219e7ad5f3f954 Mon Sep 17 00:00:00 2001 +From: Remi Collet +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 +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()); + } + -- cgit