From 21cd4a1b4845858c3421dbd5f2673eceee421f5d Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 26 Nov 2020 08:43:03 +0000 Subject: psr-4 autoloading standard --- tests/unit/Access/PermissionRolesTest.php | 101 ------------------------------ 1 file changed, 101 deletions(-) delete mode 100644 tests/unit/Access/PermissionRolesTest.php (limited to 'tests/unit/Access/PermissionRolesTest.php') diff --git a/tests/unit/Access/PermissionRolesTest.php b/tests/unit/Access/PermissionRolesTest.php deleted file mode 100644 index 58fd88bb1..000000000 --- a/tests/unit/Access/PermissionRolesTest.php +++ /dev/null @@ -1,101 +0,0 @@ -assertEquals($expectedVersion, PermissionRoles::version()); - - $pr = new PermissionRoles(); - $this->assertEquals($expectedVersion, $pr->version()); - } - - - public function testRoles() { - // Create a stub for global function t() with expectation - $t = $this->getFunctionMock('Zotlabs\Access', 't'); - $t->expects($this->atLeastOnce())->willReturnCallback( - function ($string) { - return $string; - } - ); - - $roles = PermissionRoles::roles(); - $r = new PermissionRoles(); - $this->assertEquals($roles, $r->roles()); - - $socialNetworking = [ - 'social_federation' => 'Social - Federation', - 'social' => 'Social - Mostly Public', - 'social_restricted' => 'Social - Restricted', - 'social_private' => 'Social - Private' - ]; - - $this->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"); - } - - - /** - * @uses ::call_hooks - * @uses Zotlabs\Access\PermissionLimits::Std_Limits - * @uses Zotlabs\Access\Permissions::Perms - */ - public function testRole_perms() { - // Create a stub for global function t() - $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_custom = PermissionRoles::role_perms('custom'); - $this->assertEquals(['role' => 'custom'], $rp_custom); - - $rp_nonexistent = PermissionRoles::role_perms('nonexistent'); - $this->assertEquals(['role' => 'nonexistent'], $rp_nonexistent); - } - -} -- cgit v1.2.3