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/Lib/PermissionDescriptionTest.php | 97 ---------------------------- 1 file changed, 97 deletions(-) delete mode 100644 tests/unit/Lib/PermissionDescriptionTest.php (limited to 'tests/unit/Lib') diff --git a/tests/unit/Lib/PermissionDescriptionTest.php b/tests/unit/Lib/PermissionDescriptionTest.php deleted file mode 100644 index 96c381d0c..000000000 --- a/tests/unit/Lib/PermissionDescriptionTest.php +++ /dev/null @@ -1,97 +0,0 @@ -assertEquals($permDesc, $permDesc2); - $this->assertNotEquals($permDesc, $permDesc3); - } - - public function testFromStandalonePermission() { - // Create a stub for global function t() - $t = $this->getFunctionMock('Zotlabs\Lib', 't'); - $t->expects($this->atLeastOnce())->willReturnCallback( - function ($string) { - return $string; - } - ); - // Create a mock for global function logger() - $this->getFunctionMock('Zotlabs\Lib', 'logger'); - - $permDescUnknown = PermissionDescription::fromStandalonePermission(-1); - $permDescSelf = PermissionDescription::fromStandalonePermission(0); - - $this->assertNull($permDescUnknown); - $this->assertNotNull($permDescSelf); - } - - public function testFromGlobalPermission() { - //$permDesc = PermissionDescription::fromGlobalPermission('view_profile'); - - $this->markTestIncomplete( - 'The method fromGlobalPermission() is not yet testable ...' - ); - } - - public function testGetPermissionDescription() { - // Create a stub for global function t() - $t = $this->getFunctionMock('Zotlabs\Lib', 't'); - $t->expects($this->atLeastOnce())->willReturnCallback( - function ($string) { - return $string; - } - ); - // Create a mock for global function logger() - $this->getFunctionMock('Zotlabs\Lib', 'logger'); - - // Create a stub for the PermissionDescription class - $stub = $this->createMock(PermissionDescription::class); - $stub->method('get_permission_description') - ->will($this->returnArgument(0)); - - $permDescSelf = PermissionDescription::fromStandalonePermission(0); - $this->assertInstanceOf(PermissionDescription::class, $permDescSelf); - $this->assertEquals($permDescSelf->get_permission_description(), 'Only me'); - - $permDescPublic = PermissionDescription::fromStandalonePermission(PERMS_PUBLIC); - $this->assertEquals($permDescPublic->get_permission_description(), 'Public'); - } -} -- cgit v1.2.3