summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/federation/tests/BackgroundJob/GetSharedSecretTest.php14
-rw-r--r--apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php12
-rw-r--r--apps/federation/tests/Controller/SettingsControllerTest.php9
-rw-r--r--apps/federation/tests/DbHandlerTest.php2
-rw-r--r--apps/federation/tests/Middleware/AddServerMiddlewareTest.php7
-rw-r--r--apps/federation/tests/TrustedServersTest.php18
-rw-r--r--apps/user_ldap/js/wizard/wizard.js2
-rw-r--r--apps/user_ldap/lib/Access.php3
-rw-r--r--apps/user_ldap/lib/Configuration.php5
-rw-r--r--apps/user_ldap/lib/Connection.php4
-rw-r--r--apps/user_ldap/lib/Jobs/UpdateGroups.php1
-rw-r--r--apps/user_ldap/lib/LDAP.php1
-rw-r--r--apps/user_ldap/lib/User_LDAP.php5
-rw-r--r--apps/user_ldap/lib/Wizard.php1
-rw-r--r--apps/user_ldap/tests/AccessTest.php1
-rw-r--r--apps/user_ldap/tests/ConfigurationTest.php8
-rw-r--r--apps/user_ldap/tests/Integration/Lib/IntegrationTestUserHome.php4
-rw-r--r--apps/user_ldap/tests/User/ManagerTest.php1
18 files changed, 45 insertions, 53 deletions
diff --git a/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php b/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php
index 0746c517fa7..fe7cc5cc337 100644
--- a/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php
+++ b/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php
@@ -73,15 +73,15 @@ class GetSharedSecretTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->httpClient = $this->getMock('OCP\Http\Client\IClient');
- $this->jobList = $this->getMock('OCP\BackgroundJob\IJobList');
- $this->urlGenerator = $this->getMock('OCP\IURLGenerator');
- $this->trustedServers = $this->getMockBuilder('OCA\Federation\TrustedServers')
+ $this->httpClient = $this->getMockBuilder(IClient::class)->getMock();
+ $this->jobList = $this->getMockBuilder(IJobList::class)->getMock();
+ $this->urlGenerator = $this->getMockBuilder(IURLGenerator::class)->getMock();
+ $this->trustedServers = $this->getMockBuilder(TrustedServers::class)
->disableOriginalConstructor()->getMock();
- $this->dbHandler = $this->getMockBuilder('OCA\Federation\DbHandler')
+ $this->dbHandler = $this->getMockBuilder(DbHandler::class)
->disableOriginalConstructor()->getMock();
- $this->logger = $this->getMock('OCP\ILogger');
- $this->response = $this->getMock('OCP\Http\Client\IResponse');
+ $this->logger = $this->getMockBuilder(ILogger::class)->getMock();
+ $this->response = $this->getMockBuilder(IResponse::class)->getMock();
$this->getSharedSecret = new GetSharedSecret(
$this->httpClient,
diff --git a/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php b/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php
index 339a2cbad00..3fa2ca2973e 100644
--- a/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php
+++ b/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php
@@ -61,14 +61,14 @@ class RequestSharedSecretTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->httpClient = $this->getMock('OCP\Http\Client\IClient');
- $this->jobList = $this->getMock('OCP\BackgroundJob\IJobList');
- $this->urlGenerator = $this->getMock('OCP\IURLGenerator');
- $this->trustedServers = $this->getMockBuilder('OCA\Federation\TrustedServers')
+ $this->httpClient = $this->getMockBuilder(IClient::class)->getMock();
+ $this->jobList = $this->getMockBuilder(IJobList::class)->getMock();
+ $this->urlGenerator = $this->getMockBuilder(IURLGenerator::class)->getMock();
+ $this->trustedServers = $this->getMockBuilder(TrustedServers::class)
->disableOriginalConstructor()->getMock();
- $this->dbHandler = $this->getMockBuilder('OCA\Federation\DbHandler')
+ $this->dbHandler = $this->getMockBuilder(DbHandler::class)
->disableOriginalConstructor()->getMock();
- $this->response = $this->getMock('OCP\Http\Client\IResponse');
+ $this->response = $this->getMockBuilder(IResponse::class)->getMock();
$this->requestSharedSecret = new RequestSharedSecret(
$this->httpClient,
diff --git a/apps/federation/tests/Controller/SettingsControllerTest.php b/apps/federation/tests/Controller/SettingsControllerTest.php
index e73d1f47cdd..2f93ebfeaa1 100644
--- a/apps/federation/tests/Controller/SettingsControllerTest.php
+++ b/apps/federation/tests/Controller/SettingsControllerTest.php
@@ -25,7 +25,10 @@ namespace OCA\Federation\Tests\Controller;
use OCA\Federation\Controller\SettingsController;
+use OCA\Federation\TrustedServers;
use OCP\AppFramework\Http\DataResponse;
+use OCP\IL10N;
+use OCP\IRequest;
use Test\TestCase;
class SettingsControllerTest extends TestCase {
@@ -45,9 +48,9 @@ class SettingsControllerTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->request = $this->getMock('OCP\IRequest');
- $this->l10n = $this->getMock('OCP\IL10N');
- $this->trustedServers = $this->getMockBuilder('OCA\Federation\TrustedServers')
+ $this->request = $this->getMockBuilder(IRequest::class)->getMock();
+ $this->l10n = $this->getMockBuilder(IL10N::class)->getMock();
+ $this->trustedServers = $this->getMockBuilder(TrustedServers::class)
->disableOriginalConstructor()->getMock();
$this->controller = new SettingsController(
diff --git a/apps/federation/tests/DbHandlerTest.php b/apps/federation/tests/DbHandlerTest.php
index f27317cfad9..d9f9cf162b6 100644
--- a/apps/federation/tests/DbHandlerTest.php
+++ b/apps/federation/tests/DbHandlerTest.php
@@ -53,7 +53,7 @@ class DbHandlerTest extends TestCase {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
- $this->il10n = $this->getMock('OCP\IL10N');
+ $this->il10n = $this->getMockBuilder(IL10N::class)->getMock();
$this->dbHandler = new DbHandler(
$this->connection,
diff --git a/apps/federation/tests/Middleware/AddServerMiddlewareTest.php b/apps/federation/tests/Middleware/AddServerMiddlewareTest.php
index 9eed79b0db0..b2096cb3730 100644
--- a/apps/federation/tests/Middleware/AddServerMiddlewareTest.php
+++ b/apps/federation/tests/Middleware/AddServerMiddlewareTest.php
@@ -29,6 +29,7 @@ use OC\HintException;
use OCA\Federation\Middleware\AddServerMiddleware;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\IL10N;
use OCP\ILogger;
use Test\TestCase;
@@ -49,9 +50,9 @@ class AddServerMiddlewareTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->logger = $this->getMock('OCP\ILogger');
- $this->l10n = $this->getMock('OCP\IL10N');
- $this->controller = $this->getMockBuilder('OCP\AppFramework\Controller')
+ $this->logger = $this->getMockBuilder(ILogger::class)->getMock();
+ $this->l10n = $this->getMockBuilder(IL10N::class)->getMock();
+ $this->controller = $this->getMockBuilder(Controller::class)
->disableOriginalConstructor()->getMock();
$this->middleware = new AddServerMiddleware(
diff --git a/apps/federation/tests/TrustedServersTest.php b/apps/federation/tests/TrustedServersTest.php
index 1bf1475aef2..d16c0908dd4 100644
--- a/apps/federation/tests/TrustedServersTest.php
+++ b/apps/federation/tests/TrustedServersTest.php
@@ -74,17 +74,17 @@ class TrustedServersTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->dbHandler = $this->getMockBuilder('\OCA\Federation\DbHandler')
+ $this->dbHandler = $this->getMockBuilder(DbHandler::class)
->disableOriginalConstructor()->getMock();
- $this->dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')
+ $this->dispatcher = $this->getMockBuilder(EventDispatcherInterface::class)
->disableOriginalConstructor()->getMock();
- $this->httpClientService = $this->getMock('OCP\Http\Client\IClientService');
- $this->httpClient = $this->getMock('OCP\Http\Client\IClient');
- $this->response = $this->getMock('OCP\Http\Client\IResponse');
- $this->logger = $this->getMock('OCP\ILogger');
- $this->jobList = $this->getMock('OCP\BackgroundJob\IJobList');
- $this->secureRandom = $this->getMock('OCP\Security\ISecureRandom');
- $this->config = $this->getMock('OCP\IConfig');
+ $this->httpClientService = $this->getMockBuilder(IClientService::class)->getMock();
+ $this->httpClient = $this->getMockBuilder(IClient::class)->getMock();
+ $this->response = $this->getMockBuilder(IResponse::class)->getMock();
+ $this->logger = $this->getMockBuilder(ILogger::class)->getMock();
+ $this->jobList = $this->getMockBuilder(IJobList::class)->getMock();
+ $this->secureRandom = $this->getMockBuilder(ISecureRandom::class)->getMock();
+ $this->config = $this->getMockBuilder(IConfig::class)->getMock();
$this->trustedServers = new TrustedServers(
$this->dbHandler,
diff --git a/apps/user_ldap/js/wizard/wizard.js b/apps/user_ldap/js/wizard/wizard.js
index e8450d1c78f..62a3fccbdfb 100644
--- a/apps/user_ldap/js/wizard/wizard.js
+++ b/apps/user_ldap/js/wizard/wizard.js
@@ -70,7 +70,7 @@ OCA = OCA || {};
controller.setView(view);
controller.setModel(model);
controller.run();
- }
+ };
OCA.LDAP.Wizard.Wizard = Wizard;
})();
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index 299ad581644..12d71b1528a 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -869,7 +869,7 @@ class Access extends LDAPUtility implements IUserTools {
//browsing through prior pages to get the cookie for the new one
if($skipHandling) {
- return;
+ return false;
}
// if count is bigger, then the server does not support
// paged search. Instead, he did a normal search. We set a
@@ -983,7 +983,6 @@ class Access extends LDAPUtility implements IUserTools {
$findings = array();
$savedoffset = $offset;
do {
- $continue = false;
$search = $this->executeSearch($filter, $base, $attr, $limit, $offset);
if($search === false) {
return array();
diff --git a/apps/user_ldap/lib/Configuration.php b/apps/user_ldap/lib/Configuration.php
index 2fa42efda26..54dfe6779ba 100644
--- a/apps/user_ldap/lib/Configuration.php
+++ b/apps/user_ldap/lib/Configuration.php
@@ -106,12 +106,13 @@ class Configuration {
/**
* @param string $name
- * @return mixed|void
+ * @return mixed|null
*/
public function __get($name) {
if(isset($this->config[$name])) {
return $this->config[$name];
}
+ return null;
}
/**
@@ -182,7 +183,7 @@ class Configuration {
$applied[] = $inputKey;
}
}
-
+ return null;
}
public function readConfiguration() {
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php
index 7fb26526195..07a595f0529 100644
--- a/apps/user_ldap/lib/Connection.php
+++ b/apps/user_ldap/lib/Connection.php
@@ -558,12 +558,13 @@ class Connection extends LDAPUtility {
}
return $bindStatus;
}
+ return null;
}
/**
* @param string $host
* @param string $port
- * @return false|void
+ * @return bool
* @throws \OC\ServerNotAvailableException
*/
private function doConnect($host, $port) {
@@ -580,6 +581,7 @@ class Connection extends LDAPUtility {
} else {
throw new \OC\ServerNotAvailableException('Could not set required LDAP Protocol version.');
}
+ return true;
}
/**
diff --git a/apps/user_ldap/lib/Jobs/UpdateGroups.php b/apps/user_ldap/lib/Jobs/UpdateGroups.php
index 047b95a6d9b..3b951d20c43 100644
--- a/apps/user_ldap/lib/Jobs/UpdateGroups.php
+++ b/apps/user_ldap/lib/Jobs/UpdateGroups.php
@@ -44,7 +44,6 @@ class UpdateGroups extends \OC\BackgroundJob\TimedJob {
static private $groupsFromDB;
static private $groupBE;
- static private $connector;
public function __construct(){
$this->interval = self::getRefreshInterval();
diff --git a/apps/user_ldap/lib/LDAP.php b/apps/user_ldap/lib/LDAP.php
index 5376d92a742..74d83e4ab4f 100644
--- a/apps/user_ldap/lib/LDAP.php
+++ b/apps/user_ldap/lib/LDAP.php
@@ -259,6 +259,7 @@ class LDAP implements ILDAPWrapper {
}
return $result;
}
+ return null;
}
/**
diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php
index ce1aafc210e..13e61c63c08 100644
--- a/apps/user_ldap/lib/User_LDAP.php
+++ b/apps/user_ldap/lib/User_LDAP.php
@@ -189,11 +189,6 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
$this->access->connection->ldapUserDisplayName . '=*',
$this->access->getFilterPartForUserSearch($search)
));
- $attrs = array($this->access->connection->ldapUserDisplayName, 'dn');
- $additionalAttribute = $this->access->connection->ldapUserDisplayName2;
- if(!empty($additionalAttribute)) {
- $attrs[] = $additionalAttribute;
- }
\OCP\Util::writeLog('user_ldap',
'getUsers: Options: search '.$search.' limit '.$limit.' offset '.$offset.' Filter: '.$filter,
diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php
index 573d30f0005..852c806b104 100644
--- a/apps/user_ldap/lib/Wizard.php
+++ b/apps/user_ldap/lib/Wizard.php
@@ -943,7 +943,6 @@ class Wizard extends LDAPUtility {
$cns = $this->configuration->ldapGroupFilterGroups;
if(is_array($cns) && count($cns) > 0) {
$filter .= '(|';
- $base = $this->configuration->ldapBase[0];
foreach($cns as $cn) {
$filter .= '(cn=' . $cn . ')';
}
diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php
index 2fddafa214b..5e99583c70f 100644
--- a/apps/user_ldap/tests/AccessTest.php
+++ b/apps/user_ldap/tests/AccessTest.php
@@ -201,6 +201,7 @@ class AccessTest extends \Test\TestCase {
return $case['interResult'];
}
}
+ return null;
}));
foreach($cases as $case) {
diff --git a/apps/user_ldap/tests/ConfigurationTest.php b/apps/user_ldap/tests/ConfigurationTest.php
index 9951b97e06c..797d2598be4 100644
--- a/apps/user_ldap/tests/ConfigurationTest.php
+++ b/apps/user_ldap/tests/ConfigurationTest.php
@@ -93,14 +93,6 @@ class ConfigurationTest extends \Test\TestCase {
public function testSetValue($key, $input, $expected) {
$configuration = new \OCA\User_LDAP\Configuration('t01', false);
- $settingsInput = array(
- 'ldapBaseUsers' => array(
- 'cn=someUsers,dc=example,dc=org',
- ' ',
- ' cn=moreUsers,dc=example,dc=org '
- )
- );
-
$configuration->setConfiguration([$key => $input]);
$this->assertSame($configuration->$key, $expected);
}
diff --git a/apps/user_ldap/tests/Integration/Lib/IntegrationTestUserHome.php b/apps/user_ldap/tests/Integration/Lib/IntegrationTestUserHome.php
index 95c14ca8947..2200ac327a1 100644
--- a/apps/user_ldap/tests/Integration/Lib/IntegrationTestUserHome.php
+++ b/apps/user_ldap/tests/Integration/Lib/IntegrationTestUserHome.php
@@ -111,7 +111,7 @@ class IntegrationTestUserHome extends AbstractIntegrationTest {
*/
protected function case2() {
\OC::$server->getConfig()->setAppValue('user_ldap', 'enforce_home_folder_naming_rule', true);
- $userManager = \oc::$server->getUserManager();
+ $userManager = \OC::$server->getUserManager();
// clearing backends is critical, otherwise the userManager will have
// the user objects cached and the value from case1 returned
$userManager->clearBackends();
@@ -144,7 +144,7 @@ class IntegrationTestUserHome extends AbstractIntegrationTest {
$this->connection->setConfiguration([
'homeFolderNamingRule' => 'attr:',
]);
- $userManager = \oc::$server->getUserManager();
+ $userManager = \OC::$server->getUserManager();
$userManager->clearBackends();
$userManager->registerBackend($this->backend);
$users = $userManager->search('', 5, 0);
diff --git a/apps/user_ldap/tests/User/ManagerTest.php b/apps/user_ldap/tests/User/ManagerTest.php
index 0c370f12c43..b3f22d6a068 100644
--- a/apps/user_ldap/tests/User/ManagerTest.php
+++ b/apps/user_ldap/tests/User/ManagerTest.php
@@ -208,7 +208,6 @@ class ManagerTest extends \Test\TestCase {
list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) =
$this->getTestInstances();
- $dn = 'cn=foo,dc=foobar,dc=bar';
$uid = 'gone';
$access->expects($this->never())