diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-04-12 10:57:42 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-08-09 23:45:11 +0200 |
commit | eaf352b8d11251becbbd04690af80e04e3b1e35e (patch) | |
tree | 8d9f0771440b5762b7575750821b1bfaa09950c4 /apps | |
parent | d1a8a909de471eab64bf5fac8d83a6c9fa812b33 (diff) | |
download | nextcloud-server-eaf352b8d11251becbbd04690af80e04e3b1e35e.tar.gz nextcloud-server-eaf352b8d11251becbbd04690af80e04e3b1e35e.zip |
integration test to ensure entries without displayname don't cause trouble
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/tests/Integration/Lib/IntegrationTestBatchApplyUserAttributes.php | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/apps/user_ldap/tests/Integration/Lib/IntegrationTestBatchApplyUserAttributes.php b/apps/user_ldap/tests/Integration/Lib/IntegrationTestBatchApplyUserAttributes.php deleted file mode 100644 index 24476c9a868..00000000000 --- a/apps/user_ldap/tests/Integration/Lib/IntegrationTestBatchApplyUserAttributes.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Arthur Schiwon <blizzz@arthur-schiwon.de> - * @author Joas Schilling <coding@schilljs.com> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace OCA\User_LDAP\Tests\Integration\Lib; - -use OCA\User_LDAP\Mapping\UserMapping; -use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; - -require_once __DIR__ . '/../Bootstrap.php'; - -class IntegrationTestBatchApplyUserAttributes extends AbstractIntegrationTest { - /** @var UserMapping */ - protected $mapping; - - /** - * prepares the LDAP environment and sets up a test configuration for - * the LDAP backend. - */ - public function init() { - require(__DIR__ . '/../setup-scripts/createExplicitUsers.php'); - require(__DIR__ . '/../setup-scripts/createUsersWithoutDisplayName.php'); - parent::init(); - - $this->mapping = new UserMapping(\OC::$server->getDatabaseConnection()); - $this->mapping->clear(); - $this->access->setUserMapper($this->mapping); - } - - /** - * sets up the LDAP configuration to be used for the test - */ - protected function initConnection() { - parent::initConnection(); - $this->connection->setConfiguration([ - 'ldapUserDisplayName' => 'displayname', - ]); - } - - /** - * indirectly tests whether batchApplyUserAttributes does it job properly, - * when a user without display name is included in the result set from LDAP. - * - * @return bool - */ - protected function case1() { - $result = $this->access->fetchListOfUsers('objectclass=person', 'dn'); - // on the original issue, PHP would emit a fatal error - // – cannot catch it here, but will render the test as unsuccessful - return is_array($result) && !empty($result); - } - -} - -/** @var string $host */ -/** @var int $port */ -/** @var string $adn */ -/** @var string $apwd */ -/** @var string $bdn */ -$test = new IntegrationTestBatchApplyUserAttributes($host, $port, $adn, $apwd, $bdn); -$test->init(); -$test->run(); |