fix autoloading in LPAP integration tests, resolves #544

This commit is contained in:
Arthur Schiwon 2016-07-25 10:58:03 +02:00
parent 010a8b49f3
commit 1013fac447
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
12 changed files with 37 additions and 22 deletions

View File

@ -0,0 +1,26 @@
<?php
/**
* @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
*
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
*
* @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/>
*
*/
define('CLI_TEST_RUN', true);
require_once __DIR__ . '/../../../../lib/base.php';
require_once __DIR__ . '/setup-scripts/config.php';

View File

@ -23,10 +23,9 @@
namespace OCA\User_LDAP\Tests\Integration\Lib; namespace OCA\User_LDAP\Tests\Integration\Lib;
use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest;
require_once __DIR__ . '/../../../../../lib/base.php'; require_once __DIR__ . '/../Bootstrap.php';
class IntegrationTestAccessGroupsMatchFilter extends AbstractIntegrationTest { class IntegrationTestAccessGroupsMatchFilter extends AbstractIntegrationTest {
@ -118,7 +117,6 @@ class IntegrationTestAccessGroupsMatchFilter extends AbstractIntegrationTest {
} }
} }
require_once(__DIR__ . '/../setup-scripts/config.php');
$test = new IntegrationTestAccessGroupsMatchFilter($host, $port, $adn, $apwd, $bdn); $test = new IntegrationTestAccessGroupsMatchFilter($host, $port, $adn, $apwd, $bdn);
$test->init(); $test->init();
$test->run(); $test->run();

View File

@ -27,7 +27,7 @@ use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest;
use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\Mapping\UserMapping;
use OCA\User_LDAP\User_LDAP; use OCA\User_LDAP\User_LDAP;
require_once __DIR__ . '/../../../../../lib/base.php'; require_once __DIR__ . '/../Bootstrap.php';
class IntegrationTestBackupServer extends AbstractIntegrationTest { class IntegrationTestBackupServer extends AbstractIntegrationTest {
/** @var UserMapping */ /** @var UserMapping */
@ -113,7 +113,6 @@ class IntegrationTestBackupServer extends AbstractIntegrationTest {
} }
} }
require_once(__DIR__ . '/../setup-scripts/config.php');
$test = new IntegrationTestBackupServer($host, $port, $adn, $apwd, $bdn); $test = new IntegrationTestBackupServer($host, $port, $adn, $apwd, $bdn);
$test->init(); $test->init();
$test->run(); $test->run();

View File

@ -26,7 +26,7 @@ namespace OCA\User_LDAP\Tests\Integration\Lib;
use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\Mapping\UserMapping;
use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest;
require_once __DIR__ . '/../../../../../lib/base.php'; require_once __DIR__ . '/../Bootstrap.php';
class IntegrationTestBatchApplyUserAttributes extends AbstractIntegrationTest { class IntegrationTestBatchApplyUserAttributes extends AbstractIntegrationTest {
/** /**
@ -68,7 +68,6 @@ class IntegrationTestBatchApplyUserAttributes extends AbstractIntegrationTest {
} }
require_once(__DIR__ . '/../setup-scripts/config.php');
$test = new IntegrationTestBatchApplyUserAttributes($host, $port, $adn, $apwd, $bdn); $test = new IntegrationTestBatchApplyUserAttributes($host, $port, $adn, $apwd, $bdn);
$test->init(); $test->init();
$test->run(); $test->run();

View File

@ -27,7 +27,7 @@ use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest;
use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\Mapping\UserMapping;
use OCA\User_LDAP\User_LDAP; use OCA\User_LDAP\User_LDAP;
require_once __DIR__ . '/../../../../../lib/base.php'; require_once __DIR__ . '/../Bootstrap.php';
class IntegrationTestConnect extends AbstractIntegrationTest { class IntegrationTestConnect extends AbstractIntegrationTest {
/** @var UserMapping */ /** @var UserMapping */
@ -161,7 +161,6 @@ class IntegrationTestConnect extends AbstractIntegrationTest {
} }
} }
require_once(__DIR__ . '/../setup-scripts/config.php');
$test = new IntegrationTestConnect($host, $port, $adn, $apwd, $bdn); $test = new IntegrationTestConnect($host, $port, $adn, $apwd, $bdn);
$test->init(); $test->init();
$test->run(); $test->run();

View File

@ -25,7 +25,7 @@ namespace OCA\User_LDAP\Tests\Integration\Lib;
use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest;
require_once __DIR__ . '/../../../../../lib/base.php'; require_once __DIR__ . '/../Bootstrap.php';
class IntegrationTestCountUsersByLoginName extends AbstractIntegrationTest { class IntegrationTestCountUsersByLoginName extends AbstractIntegrationTest {
@ -61,7 +61,6 @@ class IntegrationTestCountUsersByLoginName extends AbstractIntegrationTest {
} }
} }
require_once(__DIR__ . '/../setup-scripts/config.php');
$test = new IntegrationTestCountUsersByLoginName($host, $port, $adn, $apwd, $bdn); $test = new IntegrationTestCountUsersByLoginName($host, $port, $adn, $apwd, $bdn);
$test->init(); $test->init();
$test->run(); $test->run();

View File

@ -27,7 +27,7 @@ use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest;
use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\Mapping\UserMapping;
use OCA\User_LDAP\User_LDAP; use OCA\User_LDAP\User_LDAP;
require_once __DIR__ . '/../../../../../lib/base.php'; require_once __DIR__ . '/../Bootstrap.php';
class IntegrationTestFetchUsersByLoginName extends AbstractIntegrationTest { class IntegrationTestFetchUsersByLoginName extends AbstractIntegrationTest {
/** @var UserMapping */ /** @var UserMapping */
@ -74,7 +74,6 @@ class IntegrationTestFetchUsersByLoginName extends AbstractIntegrationTest {
} }
require_once(__DIR__ . '/../setup-scripts/config.php');
$test = new IntegrationTestFetchUsersByLoginName($host, $port, $adn, $apwd, $bdn); $test = new IntegrationTestFetchUsersByLoginName($host, $port, $adn, $apwd, $bdn);
$test->init(); $test->init();
$test->run(); $test->run();

View File

@ -27,7 +27,7 @@ use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest;
use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\Mapping\UserMapping;
use OCA\User_LDAP\User_LDAP; use OCA\User_LDAP\User_LDAP;
require_once __DIR__ . '/../../../../../lib/base.php'; require_once __DIR__ . '/../Bootstrap.php';
class IntegrationTestPaging extends AbstractIntegrationTest { class IntegrationTestPaging extends AbstractIntegrationTest {
/** @var UserMapping */ /** @var UserMapping */
@ -76,7 +76,6 @@ class IntegrationTestPaging extends AbstractIntegrationTest {
} }
} }
require_once(__DIR__ . '/../setup-scripts/config.php');
$test = new IntegrationTestPaging($host, $port, $adn, $apwd, $bdn); $test = new IntegrationTestPaging($host, $port, $adn, $apwd, $bdn);
$test->init(); $test->init();
$test->run(); $test->run();

View File

@ -28,7 +28,7 @@ use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest;
use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\Mapping\UserMapping;
use OCA\User_LDAP\User_LDAP; use OCA\User_LDAP\User_LDAP;
require_once __DIR__ . '/../../../../../lib/base.php'; require_once __DIR__ . '/../Bootstrap.php';
class IntegrationTestUserHome extends AbstractIntegrationTest { class IntegrationTestUserHome extends AbstractIntegrationTest {
/** @var UserMapping */ /** @var UserMapping */
@ -169,7 +169,6 @@ class IntegrationTestUserHome extends AbstractIntegrationTest {
} }
} }
require_once(__DIR__ . '/../setup-scripts/config.php');
$test = new IntegrationTestUserHome($host, $port, $adn, $apwd, $bdn); $test = new IntegrationTestUserHome($host, $port, $adn, $apwd, $bdn);
$test->init(); $test->init();
$test->run(); $test->run();

View File

@ -29,7 +29,7 @@ use OCA\User_LDAP\User\User;
use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\Mapping\UserMapping;
use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest;
require_once __DIR__ . '/../../../../../../lib/base.php'; require_once __DIR__ . '/../../Bootstrap.php';
class IntegrationTestUserAvatar extends AbstractIntegrationTest { class IntegrationTestUserAvatar extends AbstractIntegrationTest {
/** @var UserMapping */ /** @var UserMapping */
@ -148,7 +148,6 @@ class IntegrationTestUserAvatar extends AbstractIntegrationTest {
} }
} }
require_once(__DIR__ . '/../../setup-scripts/config.php');
$test = new IntegrationTestUserAvatar($host, $port, $adn, $apwd, $bdn); $test = new IntegrationTestUserAvatar($host, $port, $adn, $apwd, $bdn);
$test->init(); $test->init();
$test->run(); $test->run();

View File

@ -26,7 +26,7 @@ namespace OCA\User_LDAP\Tests\Integration\Lib\User;
use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\Mapping\UserMapping;
use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest;
require_once __DIR__ . '/../../../../../../lib/base.php'; require_once __DIR__ . '/../../Bootstrap.php';
class IntegrationTestUserDisplayName extends AbstractIntegrationTest { class IntegrationTestUserDisplayName extends AbstractIntegrationTest {
/** @var UserMapping */ /** @var UserMapping */
@ -100,7 +100,6 @@ class IntegrationTestUserDisplayName extends AbstractIntegrationTest {
} }
} }
require_once(__DIR__ . '/../../setup-scripts/config.php');
$test = new IntegrationTestUserDisplayName($host, $port, $adn, $apwd, $bdn); $test = new IntegrationTestUserDisplayName($host, $port, $adn, $apwd, $bdn);
$test->init(); $test->init();
$test->run(); $test->run();

View File

@ -169,7 +169,7 @@ class OC_App {
// Register on PSR-4 composer autoloader // Register on PSR-4 composer autoloader
$appNamespace = \OC\AppFramework\App::buildAppNamespace($app); $appNamespace = \OC\AppFramework\App::buildAppNamespace($app);
\OC::$composerAutoloader->addPsr4($appNamespace . '\\', $path . '/lib/', true); \OC::$composerAutoloader->addPsr4($appNamespace . '\\', $path . '/lib/', true);
if (defined('PHPUNIT_RUN')) { if (defined('PHPUNIT_RUN') || defined('CLI_TEST_RUN')) {
\OC::$composerAutoloader->addPsr4($appNamespace . '\\Tests\\', $path . '/tests/', true); \OC::$composerAutoloader->addPsr4($appNamespace . '\\Tests\\', $path . '/tests/', true);
} }