aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/Access/PermissionRolesTest.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-12-15 12:17:19 +0000
committerMario <mario@mariovavti.com>2021-12-15 12:17:19 +0000
commit2968bf8241d2969c4d51f1651fc3f8c7688b2fca (patch)
treedb015d27098c546c32f41682e3b7dac2480b890e /tests/unit/Access/PermissionRolesTest.php
parentb37165c62b1037e504d4b68a507241acf97ede5e (diff)
downloadvolse-hubzilla-2968bf8241d2969c4d51f1651fc3f8c7688b2fca.tar.gz
volse-hubzilla-2968bf8241d2969c4d51f1651fc3f8c7688b2fca.tar.bz2
volse-hubzilla-2968bf8241d2969c4d51f1651fc3f8c7688b2fca.zip
merge branch perms_ng into dev
Diffstat (limited to 'tests/unit/Access/PermissionRolesTest.php')
-rw-r--r--tests/unit/Access/PermissionRolesTest.php26
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);