diff options
-rw-r--r-- | tests/Psecio/Gatekeeper/PermissionCollectionTest.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/Psecio/Gatekeeper/PermissionCollectionTest.php b/tests/Psecio/Gatekeeper/PermissionCollectionTest.php index 6691a01..8e3c09a 100644 --- a/tests/Psecio/Gatekeeper/PermissionCollectionTest.php +++ b/tests/Psecio/Gatekeeper/PermissionCollectionTest.php @@ -21,4 +21,22 @@ class PermissionCollectionTest extends \Psecio\Gatekeeper\Base $permissions->findByGroupId($groupId); $this->assertCount(2, $permissions); } + + /** + * Test to ensure permissions are returned when searched by child id + */ + public function testFindChidlrenByPermissionId() + { + $permId = 1; + $return = array( + array('name' => 'perm1', 'description' => 'Permission #1'), + array('name' => 'perm2', 'description' => 'Permission #2') + ); + + $ds = $this->buildMock($return, 'fetch'); + $permissions = new PermissionCollection($ds); + + $permissions->findChildrenByPermissionId($permId); + $this->assertCount(2, $permissions); + } }
\ No newline at end of file |