diff options
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/lib/AppInfo/Application.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/tests/ConnectionTest.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/tests/GroupLDAPPluginTest.php | 16 | ||||
-rw-r--r-- | apps/user_ldap/tests/LDAPProviderTest.php | 78 | ||||
-rw-r--r-- | apps/user_ldap/tests/UserLDAPPluginTest.php | 20 | ||||
-rw-r--r-- | apps/user_ldap/tests/WizardTest.php | 6 |
6 files changed, 62 insertions, 62 deletions
diff --git a/apps/user_ldap/lib/AppInfo/Application.php b/apps/user_ldap/lib/AppInfo/Application.php index ae6092ae101..b9b4f2429b4 100644 --- a/apps/user_ldap/lib/AppInfo/Application.php +++ b/apps/user_ldap/lib/AppInfo/Application.php @@ -132,7 +132,7 @@ class Application extends App implements IBootstrap { \OCP\Util::connectHook( '\OCA\Files_Sharing\API\Server2Server', 'preLoginNameUsedAsUserName', - '\OCA\User_LDAP\Helper', + \OCA\User_LDAP\Helper::class, 'loginName2UserName' ); } diff --git a/apps/user_ldap/tests/ConnectionTest.php b/apps/user_ldap/tests/ConnectionTest.php index bc65de39f94..348a8878ea6 100644 --- a/apps/user_ldap/tests/ConnectionTest.php +++ b/apps/user_ldap/tests/ConnectionTest.php @@ -29,7 +29,7 @@ class ConnectionTest extends \Test\TestCase { $this->ldap = $this->createMock(ILDAPWrapper::class); // we use a mock here to replace the cache mechanism, due to missing DI in LDAP backend. - $this->connection = $this->getMockBuilder('OCA\User_LDAP\Connection') + $this->connection = $this->getMockBuilder(\OCA\User_LDAP\Connection::class) ->setMethods(['getFromCache', 'writeToCache']) ->setConstructorArgs([$this->ldap, '', null]) ->getMock(); diff --git a/apps/user_ldap/tests/GroupLDAPPluginTest.php b/apps/user_ldap/tests/GroupLDAPPluginTest.php index f67de32c2e9..496a86ba245 100644 --- a/apps/user_ldap/tests/GroupLDAPPluginTest.php +++ b/apps/user_ldap/tests/GroupLDAPPluginTest.php @@ -20,7 +20,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { public function testImplementsActions(): void { $pluginManager = $this->getGroupPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPGroupPluginDummy::class) ->setMethods(['respondToActions']) ->getMock(); @@ -28,7 +28,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { ->method('respondToActions') ->willReturn(GroupInterface::CREATE_GROUP); - $plugin2 = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') + $plugin2 = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPGroupPluginDummy::class) ->setMethods(['respondToActions']) ->getMock(); @@ -47,7 +47,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { public function testCreateGroup(): void { $pluginManager = $this->getGroupPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPGroupPluginDummy::class) ->setMethods(['respondToActions', 'createGroup']) ->getMock(); @@ -77,7 +77,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { public function testDeleteGroup(): void { $pluginManager = $this->getGroupPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPGroupPluginDummy::class) ->setMethods(['respondToActions', 'deleteGroup']) ->getMock(); @@ -107,7 +107,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { public function testAddToGroup(): void { $pluginManager = $this->getGroupPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPGroupPluginDummy::class) ->setMethods(['respondToActions', 'addToGroup']) ->getMock(); @@ -138,7 +138,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { public function testRemoveFromGroup(): void { $pluginManager = $this->getGroupPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPGroupPluginDummy::class) ->setMethods(['respondToActions', 'removeFromGroup']) ->getMock(); @@ -169,7 +169,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { public function testCountUsersInGroup(): void { $pluginManager = $this->getGroupPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPGroupPluginDummy::class) ->setMethods(['respondToActions', 'countUsersInGroup']) ->getMock(); @@ -200,7 +200,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { public function testgetGroupDetails(): void { $pluginManager = $this->getGroupPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPGroupPluginDummy::class) ->setMethods(['respondToActions', 'getGroupDetails']) ->getMock(); diff --git a/apps/user_ldap/tests/LDAPProviderTest.php b/apps/user_ldap/tests/LDAPProviderTest.php index e96b7b59a94..12567ccbc71 100644 --- a/apps/user_ldap/tests/LDAPProviderTest.php +++ b/apps/user_ldap/tests/LDAPProviderTest.php @@ -31,7 +31,7 @@ class LDAPProviderTest extends \Test\TestCase { } private function getServerMock(IUserLDAP $userBackend, IGroupLDAP $groupBackend) { - $server = $this->getMockBuilder('OC\Server') + $server = $this->getMockBuilder(\OC\Server::class) ->setMethods(['getUserManager', 'getBackends', 'getGroupManager']) ->setConstructorArgs(['', new \OC\Config(\OC::$configDir)]) ->getMock(); @@ -65,7 +65,7 @@ class LDAPProviderTest extends \Test\TestCase { } private function getGroupManagerMock(IGroupLDAP $groupBackend) { - $groupManager = $this->getMockBuilder('OC\Group\Manager') + $groupManager = $this->getMockBuilder(\OC\Group\Manager::class) ->setMethods(['getBackends']) ->disableOriginalConstructor() ->getMock(); @@ -76,7 +76,7 @@ class LDAPProviderTest extends \Test\TestCase { } private function getDefaultGroupBackendMock() { - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') + $groupBackend = $this->getMockBuilder(\OCA\User_LDAP\Group_LDAP::class) ->disableOriginalConstructor() ->getMock(); @@ -93,7 +93,7 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('User id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['userExists']) ->disableOriginalConstructor() ->getMock(); @@ -106,7 +106,7 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetUserDN(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['userExists', 'getLDAPAccess', 'username2dn']) ->disableOriginalConstructor() ->getMock(); @@ -132,11 +132,11 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('Group id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->disableOriginalConstructor() ->getMock(); - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') + $groupBackend = $this->getMockBuilder(\OCA\User_LDAP\Group_LDAP::class) ->setMethods(['groupExists']) ->disableOriginalConstructor() ->getMock(); @@ -150,12 +150,12 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetGroupDN(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['userExists', 'getLDAPAccess', 'username2dn']) ->disableOriginalConstructor() ->getMock(); - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') + $groupBackend = $this->getMockBuilder(\OCA\User_LDAP\Group_LDAP::class) ->setMethods(['groupExists', 'getLDAPAccess', 'groupname2dn']) ->disableOriginalConstructor() ->getMock(); @@ -178,7 +178,7 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetUserName(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['dn2UserName']) ->disableOriginalConstructor() ->getMock(); @@ -194,7 +194,7 @@ class LDAPProviderTest extends \Test\TestCase { } public function testDNasBaseParameter(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods([]) ->disableOriginalConstructor() ->getMock(); @@ -210,7 +210,7 @@ class LDAPProviderTest extends \Test\TestCase { } public function testSanitizeDN(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods([]) ->disableOriginalConstructor() ->getMock(); @@ -230,7 +230,7 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('User id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['userExists']) ->disableOriginalConstructor() ->getMock(); @@ -243,7 +243,7 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetLDAPConnection(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['userExists', 'getNewLDAPConnection']) ->disableOriginalConstructor() ->getMock(); @@ -266,11 +266,11 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('Group id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->disableOriginalConstructor() ->getMock(); - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') + $groupBackend = $this->getMockBuilder(\OCA\User_LDAP\Group_LDAP::class) ->setMethods(['groupExists']) ->disableOriginalConstructor() ->getMock(); @@ -284,11 +284,11 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetGroupLDAPConnection(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->disableOriginalConstructor() ->getMock(); - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') + $groupBackend = $this->getMockBuilder(\OCA\User_LDAP\Group_LDAP::class) ->setMethods(['groupExists','getNewLDAPConnection']) ->disableOriginalConstructor() ->getMock(); @@ -313,7 +313,7 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('User id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['userExists']) ->disableOriginalConstructor() ->getMock(); @@ -354,7 +354,7 @@ class LDAPProviderTest extends \Test\TestCase { ->method('username2dn') ->willReturn($dn); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration']) ->disableOriginalConstructor() ->getMock(); @@ -376,7 +376,7 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('User id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['userExists']) ->disableOriginalConstructor() ->getMock(); @@ -410,7 +410,7 @@ class LDAPProviderTest extends \Test\TestCase { ->method('getConnection') ->willReturn($connection); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration']) ->disableOriginalConstructor() ->getMock(); @@ -432,7 +432,7 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('User id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['userExists']) ->disableOriginalConstructor() ->getMock(); @@ -445,7 +445,7 @@ class LDAPProviderTest extends \Test\TestCase { } public function testClearCache(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'clearCache']) ->disableOriginalConstructor() ->getMock(); @@ -471,10 +471,10 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('Group id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->disableOriginalConstructor() ->getMock(); - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') + $groupBackend = $this->getMockBuilder(\OCA\User_LDAP\Group_LDAP::class) ->setMethods(['groupExists']) ->disableOriginalConstructor() ->getMock(); @@ -487,10 +487,10 @@ class LDAPProviderTest extends \Test\TestCase { } public function testClearGroupCache(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->disableOriginalConstructor() ->getMock(); - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') + $groupBackend = $this->getMockBuilder(\OCA\User_LDAP\Group_LDAP::class) ->setMethods(['groupExists', 'getLDAPAccess', 'getConnection', 'clearCache']) ->disableOriginalConstructor() ->getMock(); @@ -512,7 +512,7 @@ class LDAPProviderTest extends \Test\TestCase { } public function testDnExists(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['dn2UserName']) ->disableOriginalConstructor() ->getMock(); @@ -527,7 +527,7 @@ class LDAPProviderTest extends \Test\TestCase { } public function testFlagRecord(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods([]) ->disableOriginalConstructor() ->getMock(); @@ -540,7 +540,7 @@ class LDAPProviderTest extends \Test\TestCase { } public function testUnflagRecord(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods([]) ->disableOriginalConstructor() ->getMock(); @@ -557,7 +557,7 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('User id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['userExists']) ->disableOriginalConstructor() ->getMock(); @@ -570,7 +570,7 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetLDAPDisplayNameField(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration']) ->disableOriginalConstructor() ->getMock(); @@ -595,7 +595,7 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('User id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['userExists']) ->disableOriginalConstructor() ->getMock(); @@ -608,7 +608,7 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetLDAPEmailField(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration']) ->disableOriginalConstructor() ->getMock(); @@ -633,11 +633,11 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('Group id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->disableOriginalConstructor() ->getMock(); - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') + $groupBackend = $this->getMockBuilder(\OCA\User_LDAP\Group_LDAP::class) ->setMethods(['groupExists']) ->disableOriginalConstructor() ->getMock(); @@ -651,11 +651,11 @@ class LDAPProviderTest extends \Test\TestCase { } public function testgetLDAPGroupMemberAssoc(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(\OCA\User_LDAP\User_LDAP::class) ->disableOriginalConstructor() ->getMock(); - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') + $groupBackend = $this->getMockBuilder(\OCA\User_LDAP\Group_LDAP::class) ->setMethods(['groupExists', 'getLDAPAccess', 'getConnection', 'getConfiguration']) ->disableOriginalConstructor() ->getMock(); diff --git a/apps/user_ldap/tests/UserLDAPPluginTest.php b/apps/user_ldap/tests/UserLDAPPluginTest.php index 5f11f817771..cefc98b3a5e 100644 --- a/apps/user_ldap/tests/UserLDAPPluginTest.php +++ b/apps/user_ldap/tests/UserLDAPPluginTest.php @@ -20,7 +20,7 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testImplementsActions(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPUserPluginDummy::class) ->setMethods(['respondToActions']) ->getMock(); @@ -28,7 +28,7 @@ class UserLDAPPluginTest extends \Test\TestCase { ->method('respondToActions') ->willReturn(Backend::CREATE_USER); - $plugin2 = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') + $plugin2 = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPUserPluginDummy::class) ->setMethods(['respondToActions']) ->getMock(); @@ -47,7 +47,7 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testCreateUser(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPUserPluginDummy::class) ->setMethods(['respondToActions', 'createUser']) ->getMock(); @@ -78,7 +78,7 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testSetPassword(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPUserPluginDummy::class) ->setMethods(['respondToActions', 'setPassword']) ->getMock(); @@ -109,7 +109,7 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testGetHome(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPUserPluginDummy::class) ->setMethods(['respondToActions', 'getHome']) ->getMock(); @@ -139,7 +139,7 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testGetDisplayName(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPUserPluginDummy::class) ->setMethods(['respondToActions', 'getDisplayName']) ->getMock(); @@ -169,7 +169,7 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testSetDisplayName(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPUserPluginDummy::class) ->setMethods(['respondToActions', 'setDisplayName']) ->getMock(); @@ -200,7 +200,7 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testCanChangeAvatar(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPUserPluginDummy::class) ->setMethods(['respondToActions', 'canChangeAvatar']) ->getMock(); @@ -230,7 +230,7 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testCountUsers(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPUserPluginDummy::class) ->setMethods(['respondToActions', 'countUsers']) ->getMock(); @@ -257,7 +257,7 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testDeleteUser(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') + $plugin = $this->getMockBuilder(\OCA\User_LDAP\Tests\LDAPUserPluginDummy::class) ->setMethods(['respondToActions', 'canDeleteUser','deleteUser']) ->getMock(); diff --git a/apps/user_ldap/tests/WizardTest.php b/apps/user_ldap/tests/WizardTest.php index 31fd28e2fa1..9595af15a99 100644 --- a/apps/user_ldap/tests/WizardTest.php +++ b/apps/user_ldap/tests/WizardTest.php @@ -41,9 +41,9 @@ class WizardTest extends TestCase { static $accMethods; if (is_null($confMethods)) { - $confMethods = get_class_methods('\OCA\User_LDAP\Configuration'); - $connMethods = get_class_methods('\OCA\User_LDAP\Connection'); - $accMethods = get_class_methods('\OCA\User_LDAP\Access'); + $confMethods = get_class_methods(\OCA\User_LDAP\Configuration::class); + $connMethods = get_class_methods(\OCA\User_LDAP\Connection::class); + $accMethods = get_class_methods(\OCA\User_LDAP\Access::class); } /** @var ILDAPWrapper|\PHPUnit\Framework\MockObject\MockObject $lw */ $lw = $this->createMock(ILDAPWrapper::class); |