diff options
author | mjfriaza <mjfriaza@disroot.org> | 2022-05-17 13:44:06 +0200 |
---|---|---|
committer | mjfriaza <mjfriaza@disroot.org> | 2022-05-17 13:44:06 +0200 |
commit | a75c61d71efebf43713026200aa0f513bd7eef09 (patch) | |
tree | 909048adeaa329813e2530d43626ed3bd711bc25 /tests/unit/Access/PermissionRolesTest.php | |
parent | 481ecee9e87342ca7a1217395085e95d1a3b61ea (diff) | |
parent | 0d0f73fb67bbfcc53058cefded85ac36f951c7a7 (diff) | |
download | volse-hubzilla-a75c61d71efebf43713026200aa0f513bd7eef09.tar.gz volse-hubzilla-a75c61d71efebf43713026200aa0f513bd7eef09.tar.bz2 volse-hubzilla-a75c61d71efebf43713026200aa0f513bd7eef09.zip |
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'tests/unit/Access/PermissionRolesTest.php')
-rw-r--r-- | tests/unit/Access/PermissionRolesTest.php | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/tests/unit/Access/PermissionRolesTest.php b/tests/unit/Access/PermissionRolesTest.php index dd55eb6e2..3d3cbbae5 100644 --- a/tests/unit/Access/PermissionRolesTest.php +++ b/tests/unit/Access/PermissionRolesTest.php @@ -40,7 +40,7 @@ class PermissionRolesTest extends UnitTestCase { use PHPMock; public function testVersion() { - $expectedVersion = 2; + $expectedVersion = 3; $this->assertEquals($expectedVersion, PermissionRoles::version()); @@ -58,23 +58,12 @@ class PermissionRolesTest extends UnitTestCase { } ); - $roles = PermissionRoles::roles(); + $roles = PermissionRoles::channel_roles(); $r = new PermissionRoles(); - $this->assertEquals($roles, $r->roles()); + $this->assertEquals($roles, $r->channel_roles()); - $socialNetworking = [ - 'social_federation' => 'Social - Federation', - 'social' => 'Social - Mostly Public', - 'social_restricted' => 'Social - Restricted', - 'social_private' => 'Social - Private' - ]; + $this->assertCount(4, $roles, 'There should be 4 channel roles.'); - Assert::assertArraySubset(['Social Networking' => $socialNetworking], $roles); - $this->assertEquals($socialNetworking, $roles['Social Networking']); - - $this->assertCount(5, $roles, 'There should be 5 permission groups.'); - - $this->assertCount(1, $roles['Other'], "In the 'Other' group should be just one permission role"); } @@ -88,12 +77,9 @@ class PermissionRolesTest extends UnitTestCase { $t = $this->getFunctionMock('Zotlabs\Access', 't'); $t = $this->getFunctionMock('Zotlabs\Access', 'get_config'); - $rp_social = PermissionRoles::role_perms('social'); - $this->assertEquals('social', $rp_social['role']); - + $rp_social = PermissionRoles::role_perms('personal'); + $this->assertEquals('personal', $rp_social['role']); - $rp_custom = PermissionRoles::role_perms('custom'); - $this->assertEquals(['role' => 'custom'], $rp_custom); $rp_nonexistent = PermissionRoles::role_perms('nonexistent'); $this->assertEquals(['role' => 'nonexistent'], $rp_nonexistent); |