diff options
author | Chris Cornutt <enygma@phpdeveloper.org> | 2015-01-25 23:26:24 +0100 |
---|---|---|
committer | Chris Cornutt <enygma@phpdeveloper.org> | 2015-01-25 23:26:24 +0100 |
commit | 759cbfcacad70fdcb943e43c48c52677da5556e0 (patch) | |
tree | e4622d52d920907c961d2c037b500176d50bbd4b | |
parent | d28e80f50d291bbfcdd83a47d8a20285de68f978 (diff) | |
download | gatekeeper-759cbfcacad70fdcb943e43c48c52677da5556e0.zip gatekeeper-759cbfcacad70fdcb943e43c48c52677da5556e0.tar.gz gatekeeper-759cbfcacad70fdcb943e43c48c52677da5556e0.tar.bz2 |
adding test for getting child permissions by perm id
-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 |