aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/tests/GroupLDAPPluginTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/tests/GroupLDAPPluginTest.php')
-rw-r--r--apps/user_ldap/tests/GroupLDAPPluginTest.php40
1 files changed, 19 insertions, 21 deletions
diff --git a/apps/user_ldap/tests/GroupLDAPPluginTest.php b/apps/user_ldap/tests/GroupLDAPPluginTest.php
index f67de32c2e9..9f4cff64d6b 100644
--- a/apps/user_ldap/tests/GroupLDAPPluginTest.php
+++ b/apps/user_ldap/tests/GroupLDAPPluginTest.php
@@ -1,4 +1,6 @@
<?php
+
+declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -9,27 +11,23 @@ use OCA\User_LDAP\GroupPluginManager;
use OCP\GroupInterface;
class GroupLDAPPluginTest extends \Test\TestCase {
-
- /**
- * @return GroupPluginManager
- */
- private function getGroupPluginManager() {
+ private function getGroupPluginManager(): GroupPluginManager {
return new GroupPluginManager();
}
public function testImplementsActions(): void {
$pluginManager = $this->getGroupPluginManager();
- $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy')
- ->setMethods(['respondToActions'])
+ $plugin = $this->getMockBuilder(LDAPGroupPluginDummy::class)
+ ->onlyMethods(['respondToActions'])
->getMock();
$plugin->expects($this->any())
->method('respondToActions')
->willReturn(GroupInterface::CREATE_GROUP);
- $plugin2 = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy')
- ->setMethods(['respondToActions'])
+ $plugin2 = $this->getMockBuilder(LDAPGroupPluginDummy::class)
+ ->onlyMethods(['respondToActions'])
->getMock();
$plugin2->expects($this->any())
@@ -47,8 +45,8 @@ class GroupLDAPPluginTest extends \Test\TestCase {
public function testCreateGroup(): void {
$pluginManager = $this->getGroupPluginManager();
- $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy')
- ->setMethods(['respondToActions', 'createGroup'])
+ $plugin = $this->getMockBuilder(LDAPGroupPluginDummy::class)
+ ->onlyMethods(['respondToActions', 'createGroup'])
->getMock();
$plugin->expects($this->any())
@@ -77,8 +75,8 @@ class GroupLDAPPluginTest extends \Test\TestCase {
public function testDeleteGroup(): void {
$pluginManager = $this->getGroupPluginManager();
- $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy')
- ->setMethods(['respondToActions', 'deleteGroup'])
+ $plugin = $this->getMockBuilder(LDAPGroupPluginDummy::class)
+ ->onlyMethods(['respondToActions', 'deleteGroup'])
->getMock();
$plugin->expects($this->any())
@@ -107,8 +105,8 @@ class GroupLDAPPluginTest extends \Test\TestCase {
public function testAddToGroup(): void {
$pluginManager = $this->getGroupPluginManager();
- $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy')
- ->setMethods(['respondToActions', 'addToGroup'])
+ $plugin = $this->getMockBuilder(LDAPGroupPluginDummy::class)
+ ->onlyMethods(['respondToActions', 'addToGroup'])
->getMock();
$plugin->expects($this->any())
@@ -138,8 +136,8 @@ class GroupLDAPPluginTest extends \Test\TestCase {
public function testRemoveFromGroup(): void {
$pluginManager = $this->getGroupPluginManager();
- $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy')
- ->setMethods(['respondToActions', 'removeFromGroup'])
+ $plugin = $this->getMockBuilder(LDAPGroupPluginDummy::class)
+ ->onlyMethods(['respondToActions', 'removeFromGroup'])
->getMock();
$plugin->expects($this->any())
@@ -169,8 +167,8 @@ class GroupLDAPPluginTest extends \Test\TestCase {
public function testCountUsersInGroup(): void {
$pluginManager = $this->getGroupPluginManager();
- $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy')
- ->setMethods(['respondToActions', 'countUsersInGroup'])
+ $plugin = $this->getMockBuilder(LDAPGroupPluginDummy::class)
+ ->onlyMethods(['respondToActions', 'countUsersInGroup'])
->getMock();
$plugin->expects($this->any())
@@ -200,8 +198,8 @@ class GroupLDAPPluginTest extends \Test\TestCase {
public function testgetGroupDetails(): void {
$pluginManager = $this->getGroupPluginManager();
- $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy')
- ->setMethods(['respondToActions', 'getGroupDetails'])
+ $plugin = $this->getMockBuilder(LDAPGroupPluginDummy::class)
+ ->onlyMethods(['respondToActions', 'getGroupDetails'])
->getMock();
$plugin->expects($this->any())