Move tests/ to PSR-4

This commit is contained in:
Joas Schilling 2016-05-12 17:14:59 +02:00
parent b616318327
commit 3ef8c95b37
No known key found for this signature in database
GPG Key ID: 70A0B324C41C0946
32 changed files with 61 additions and 66 deletions

View File

@ -23,19 +23,19 @@
* *
*/ */
namespace OCA\user_ldap\tests; namespace OCA\User_LDAP\Tests;
use OCA\User_LDAP\Access; use OCA\User_LDAP\Access;
use OCA\User_LDAP\Connection; use OCA\User_LDAP\Connection;
/** /**
* Class Test_Access * Class AccessTest
* *
* @group DB * @group DB
* *
* @package OCA\user_ldap\tests * @package OCA\User_LDAP\Tests
*/ */
class Test_Access extends \Test\TestCase { class AccessTest extends \Test\TestCase {
private function getConnectorAndLdapMock() { private function getConnectorAndLdapMock() {
static $conMethods; static $conMethods;
static $accMethods; static $accMethods;

View File

@ -19,9 +19,9 @@
* *
*/ */
namespace OCA\user_ldap\tests; namespace OCA\User_LDAP\Tests;
class Test_Configuration extends \Test\TestCase { class ConfigurationTest extends \Test\TestCase {
public function configurationDataProvider() { public function configurationDataProvider() {
$inputWithDN = array( $inputWithDN = array(

View File

@ -22,7 +22,7 @@
* *
*/ */
namespace OCA\user_ldap\tests; namespace OCA\User_LDAP\Tests;
use OCA\User_LDAP\Connection; use OCA\User_LDAP\Connection;
/** /**
@ -30,9 +30,9 @@ use OCA\User_LDAP\Connection;
* *
* @group DB * @group DB
* *
* @package OCA\user_ldap\tests * @package OCA\User_LDAP\Tests
*/ */
class Test_Connection extends \Test\TestCase { class ConnectionTest extends \Test\TestCase {
/** @var \OCA\User_LDAP\ILDAPWrapper */ /** @var \OCA\User_LDAP\ILDAPWrapper */
protected $ldap; protected $ldap;

View File

@ -35,9 +35,9 @@ use OCA\User_LDAP\Connection;
* *
* @group DB * @group DB
* *
* @package OCA\user_ldap\tests * @package OCA\User_LDAP\Tests
*/ */
class GroupLDAPTest extends \Test\TestCase { class Group_LDAPTest extends \Test\TestCase {
private function getAccessMock() { private function getAccessMock() {
static $conMethods; static $conMethods;
static $accMethods; static $accMethods;

View File

@ -19,7 +19,7 @@
* *
*/ */
namespace OCA\user_ldap\tests\integration; namespace OCA\User_LDAP\Tests\Integration;
use OCA\User_LDAP\Access; use OCA\User_LDAP\Access;
use OCA\User_LDAP\Connection; use OCA\User_LDAP\Connection;

View File

@ -19,6 +19,9 @@
* *
*/ */
namespace OCA\User_LDAP\Tests\Integration;
use OC\ServerNotAvailableException; use OC\ServerNotAvailableException;
use OCA\User_LDAP\LDAP; use OCA\User_LDAP\LDAP;

View File

@ -19,7 +19,7 @@
* *
*/ */
namespace OCA\user_ldap\tests\integration; namespace OCA\User_LDAP\Tests\Integration;
/** /**
* Class FakeManager * Class FakeManager

View File

@ -19,10 +19,10 @@
* *
*/ */
namespace OCA\user_ldap\tests\integration\lib; namespace OCA\User_LDAP\Tests\Integration\Lib;
use OCA\User_LDAP\Connection;
use OCA\user_ldap\tests\integration\AbstractIntegrationTest; use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest;
require_once __DIR__ . '/../../../../../lib/base.php'; require_once __DIR__ . '/../../../../../lib/base.php';

View File

@ -19,15 +19,15 @@
* *
*/ */
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;
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__ . '/../../../../../lib/base.php';
class IntegrationBackupServer extends AbstractIntegrationTest { class IntegrationTestBackupServer extends AbstractIntegrationTest {
/** @var UserMapping */ /** @var UserMapping */
protected $mapping; protected $mapping;

View File

@ -19,10 +19,10 @@
* *
*/ */
namespace OCA\user_ldap\tests\integration\lib; 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__ . '/../../../../../lib/base.php';

View File

@ -19,16 +19,15 @@
* *
*/ */
namespace OCA\user_ldap\tests\integration\lib; namespace OCA\User_LDAP\Tests\Integration\Lib;
use OCA\User_LDAP\User\Manager as LDAPUserManager; use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest;
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__ . '/../../../../../lib/base.php';
class IntegrationConnect extends AbstractIntegrationTest { class IntegrationTestConnect extends AbstractIntegrationTest {
/** @var UserMapping */ /** @var UserMapping */
protected $mapping; protected $mapping;

View File

@ -19,16 +19,13 @@
* *
*/ */
namespace OCA\user_ldap\tests\integration\lib; namespace OCA\User_LDAP\Tests\Integration\Lib;
use OCA\User_LDAP\User\Manager as LDAPUserManager; use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest;
use OCA\user_ldap\tests\integration\AbstractIntegrationTest;
use OCA\User_LDAP\Mapping\UserMapping;
use OCA\User_LDAP\User_LDAP;
require_once __DIR__ . '/../../../../../lib/base.php'; require_once __DIR__ . '/../../../../../lib/base.php';
class IntegrationTestUserHome extends AbstractIntegrationTest { class IntegrationTestCountUsersByLoginName extends AbstractIntegrationTest {
/** /**
* prepares the LDAP environment and sets up a test configuration for * prepares the LDAP environment and sets up a test configuration for

View File

@ -19,16 +19,15 @@
* *
*/ */
namespace OCA\user_ldap\tests\integration\lib; namespace OCA\User_LDAP\Tests\Integration\Lib;
use OCA\User_LDAP\User\Manager as LDAPUserManager; use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest;
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__ . '/../../../../../lib/base.php';
class IntegrationTestUserHome extends AbstractIntegrationTest { class IntegrationTestFetchUsersByLoginName extends AbstractIntegrationTest {
/** @var UserMapping */ /** @var UserMapping */
protected $mapping; protected $mapping;

View File

@ -19,10 +19,9 @@
* *
*/ */
namespace OCA\user_ldap\tests\integration\lib; namespace OCA\User_LDAP\Tests\Integration\Lib;
use OCA\User_LDAP\User\Manager as LDAPUserManager; use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest;
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;

View File

@ -19,10 +19,10 @@
* *
*/ */
namespace OCA\user_ldap\tests\integration\lib; namespace OCA\User_LDAP\Tests\Integration\Lib;
use OCA\User_LDAP\User\Manager as LDAPUserManager; use OCA\User_LDAP\User\Manager as LDAPUserManager;
use OCA\user_ldap\tests\integration\AbstractIntegrationTest; 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;

View File

@ -21,9 +21,11 @@
* *
*/ */
namespace OCA\User_LDAP\Tests\Integration\Lib\User;
use OCA\User_LDAP\User\User; 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__ . '/../../../../../../lib/base.php';
@ -41,7 +43,7 @@ class IntegrationTestUserAvatar extends AbstractIntegrationTest {
$this->mapping = new UserMapping(\OC::$server->getDatabaseConnection()); $this->mapping = new UserMapping(\OC::$server->getDatabaseConnection());
$this->mapping->clear(); $this->mapping->clear();
$this->access->setUserMapper($this->mapping); $this->access->setUserMapper($this->mapping);
$userBackend = new OCA\User_LDAP\User_LDAP($this->access, \OC::$server->getConfig()); $userBackend = new \OCA\User_LDAP\User_LDAP($this->access, \OC::$server->getConfig());
\OC_User::useBackend($userBackend); \OC_User::useBackend($userBackend);
} }

View File

@ -19,9 +19,10 @@
* *
*/ */
use OCA\User_LDAP\User\User; 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__ . '/../../../../../../lib/base.php';
@ -39,7 +40,7 @@ class IntegrationTestUserDisplayName extends AbstractIntegrationTest {
$this->mapping = new UserMapping(\OC::$server->getDatabaseConnection()); $this->mapping = new UserMapping(\OC::$server->getDatabaseConnection());
$this->mapping->clear(); $this->mapping->clear();
$this->access->setUserMapper($this->mapping); $this->access->setUserMapper($this->mapping);
$userBackend = new OCA\User_LDAP\User_LDAP($this->access, \OC::$server->getConfig()); $userBackend = new \OCA\User_LDAP\User_LDAP($this->access, \OC::$server->getConfig());
\OC_User::useBackend($userBackend); \OC_User::useBackend($userBackend);
} }

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 93 KiB

View File

@ -20,9 +20,9 @@
* *
*/ */
namespace OCA\user_ldap\tests; namespace OCA\User_LDAP\Tests\Jobs;
class Test_CleanUp extends \PHPUnit_Framework_TestCase { class CleanUpTest extends \Test\TestCase {
public function getMocks() { public function getMocks() {
$mocks = array(); $mocks = array();
$mocks['userBackend'] = $mocks['userBackend'] =

View File

@ -20,7 +20,7 @@
* *
*/ */
namespace OCA\user_ldap\tests\mapping; namespace OCA\User_LDAP\Tests\Mapping;
abstract class AbstractMappingTest extends \Test\TestCase { abstract class AbstractMappingTest extends \Test\TestCase {
abstract public function getMapper(\OCP\IDBConnection $dbMock); abstract public function getMapper(\OCP\IDBConnection $dbMock);

View File

@ -21,18 +21,18 @@
* *
*/ */
namespace OCA\user_ldap\tests\mapping; namespace OCA\User_LDAP\Tests\Mapping;
use OCA\User_LDAP\Mapping\GroupMapping; use OCA\User_LDAP\Mapping\GroupMapping;
/** /**
* Class Test_GroupMapping * Class GroupMappingTest
* *
* @group DB * @group DB
* *
* @package OCA\user_ldap\tests\mapping * @package OCA\User_LDAP\Tests\Mapping
*/ */
class Test_GroupMapping extends AbstractMappingTest { class GroupMappingTest extends AbstractMappingTest {
public function getMapper(\OCP\IDBConnection $dbMock) { public function getMapper(\OCP\IDBConnection $dbMock) {
return new GroupMapping($dbMock); return new GroupMapping($dbMock);
} }

View File

@ -21,18 +21,18 @@
* *
*/ */
namespace OCA\user_ldap\tests\mapping; namespace OCA\User_LDAP\Tests\Mapping;
use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\Mapping\UserMapping;
/** /**
* Class Test_UserMapping * Class UserMappingTest
* *
* @group DB * @group DB
* *
* @package OCA\user_ldap\tests\mapping * @package OCA\User_LDAP\Tests\Mapping
*/ */
class Test_UserMapping extends AbstractMappingTest { class UserMappingTest extends AbstractMappingTest {
public function getMapper(\OCP\IDBConnection $dbMock) { public function getMapper(\OCP\IDBConnection $dbMock) {
return new UserMapping($dbMock); return new UserMapping($dbMock);
} }

View File

@ -32,7 +32,7 @@ use OCA\User_LDAP\User\Manager;
* *
* @group DB * @group DB
* *
* @package OCA\user_ldap\tests * @package OCA\User_LDAP\Tests\User
*/ */
class ManagerTest extends \Test\TestCase { class ManagerTest extends \Test\TestCase {

View File

@ -28,11 +28,11 @@ use OCA\User_LDAP\User\User;
use OCP\IUserManager; use OCP\IUserManager;
/** /**
* Class Test_User_User * Class UserTest
* *
* @group DB * @group DB
* *
* @package OCA\user_ldap\tests * @package OCA\User_LDAP\Tests\User
*/ */
class UserTest extends \Test\TestCase { class UserTest extends \Test\TestCase {

View File

@ -23,21 +23,16 @@
* *
*/ */
namespace OCA\User_LDAP\tests; namespace OCA\User_LDAP\Tests;
use \OCA\User_LDAP\Wizard; use \OCA\User_LDAP\Wizard;
// use \OCA\User_LDAP\User_LDAP as UserLDAP;
// use \OCA\User_LDAP\Access;
// use \OCA\User_LDAP\Configuration;
// use \OCA\User_LDAP\ILDAPWrapper;
/** /**
* Class Test_Wizard * Class Test_Wizard
* *
* @group DB * @group DB
* *
* @package OCA\User_LDAP\tests * @package OCA\User_LDAP\Tests
*/ */
class WizardTest extends \Test\TestCase { class WizardTest extends \Test\TestCase {
protected function setUp() { protected function setUp() {