Merge pull request #20248 from owncloud/use-phpunit-groups-to-run-database-code-in-isolation

Use phpunit groups to run database code in isolation
This commit is contained in:
Thomas Müller 2015-11-30 14:25:35 +01:00
commit fc21aa6c41
150 changed files with 991 additions and 112 deletions

View File

@ -1,6 +1,8 @@
<?php <?php
define('PHPUNIT_RUN', 1); if (!defined('PHPUNIT_RUN')) {
define('PHPUNIT_RUN', 1);
}
require_once __DIR__.'/../../../../lib/base.php'; require_once __DIR__.'/../../../../lib/base.php';

View File

@ -8,6 +8,14 @@ namespace OCA\DAV\Tests\Unit\Connector\Sabre;
* later. * later.
* See the COPYING-README file. * See the COPYING-README file.
*/ */
/**
* Class CustomPropertiesBackend
*
* @group DB
*
* @package Tests\Connector\Sabre
*/
class CustomPropertiesBackend extends \Test\TestCase { class CustomPropertiesBackend extends \Test\TestCase {
/** /**

View File

@ -14,6 +14,13 @@ use Test\HookHelper;
use OC\Files\Filesystem; use OC\Files\Filesystem;
use OCP\Lock\ILockingProvider; use OCP\Lock\ILockingProvider;
/**
* Class File
*
* @group DB
*
* @package Test\Connector\Sabre
*/
class File extends \Test\TestCase { class File extends \Test\TestCase {
/** /**

View File

@ -41,6 +41,13 @@ class TestDoubleFileView extends \OC\Files\View {
} }
} }
/**
* Class ObjectTree
*
* @group DB
*
* @package OCA\DAV\Tests\Unit\Connector\Sabre
*/
class ObjectTree extends \Test\TestCase { class ObjectTree extends \Test\TestCase {
/** /**

View File

@ -11,6 +11,13 @@ namespace OCA\DAV\Tests\Unit\Connector\Sabre\RequestTest;
use OCP\AppFramework\Http; use OCP\AppFramework\Http;
use OCP\Lock\ILockingProvider; use OCP\Lock\ILockingProvider;
/**
* Class DownloadTest
*
* @group DB
*
* @package OCA\DAV\Tests\Unit\Connector\Sabre\RequestTest
*/
class DownloadTest extends RequestTest { class DownloadTest extends RequestTest {
public function testDownload() { public function testDownload() {
$user = $this->getUniqueID(); $user = $this->getUniqueID();

View File

@ -11,6 +11,13 @@ namespace OCA\DAV\Tests\Unit\Connector\Sabre\RequestTest;
use OC\Files\View; use OC\Files\View;
use Test\Traits\EncryptionTrait; use Test\Traits\EncryptionTrait;
/**
* Class EncryptionUploadTest
*
* @group DB
*
* @package OCA\DAV\Tests\Unit\Connector\Sabre\RequestTest
*/
class EncryptionUploadTest extends UploadTest { class EncryptionUploadTest extends UploadTest {
use EncryptionTrait; use EncryptionTrait;

View File

@ -12,6 +12,13 @@ use OC\Connector\Sabre\Exception\FileLocked;
use OCP\AppFramework\Http; use OCP\AppFramework\Http;
use OCP\Lock\ILockingProvider; use OCP\Lock\ILockingProvider;
/**
* Class UploadTest
*
* @group DB
*
* @package OCA\DAV\Tests\Unit\Connector\Sabre\RequestTest
*/
class UploadTest extends RequestTest { class UploadTest extends RequestTest {
public function testBasicUpload() { public function testBasicUpload() {
$user = $this->getUniqueID(); $user = $this->getUniqueID();

View File

@ -34,6 +34,13 @@ use OCP\Http\Client\IResponse;
use OCP\ILogger; use OCP\ILogger;
use OCP\IURLGenerator; use OCP\IURLGenerator;
/**
* Class GetSharedSecretTest
*
* @group DB
*
* @package OCA\Federation\Tests\BackgroundJob
*/
class GetSharedSecretTest extends TestCase { class GetSharedSecretTest extends TestCase {
/** @var \PHPUnit_Framework_MockObject_MockObject | IClient */ /** @var \PHPUnit_Framework_MockObject_MockObject | IClient */

View File

@ -25,6 +25,13 @@ namespace OCA\Files\Tests\Command;
use OCA\Files\Command\DeleteOrphanedFiles; use OCA\Files\Command\DeleteOrphanedFiles;
use OCP\Files\StorageNotAvailableException; use OCP\Files\StorageNotAvailableException;
/**
* Class DeleteOrphanedFilesTest
*
* @group DB
*
* @package OCA\Files\Tests\Command
*/
class DeleteOrphanedFilesTest extends \Test\TestCase { class DeleteOrphanedFilesTest extends \Test\TestCase {
/** /**

View File

@ -22,6 +22,13 @@ namespace OCA\Files;
use \OCA\Files\Service\TagService; use \OCA\Files\Service\TagService;
/**
* Class TagServiceTest
*
* @group DB
*
* @package OCA\Files
*/
class TagServiceTest extends \Test\TestCase { class TagServiceTest extends \Test\TestCase {
/** /**

View File

@ -25,6 +25,13 @@
namespace Test\Files\Storage; namespace Test\Files\Storage;
/**
* Class AmazonS3Migration
*
* @group DB
*
* @package Test\Files\Storage
*/
class AmazonS3Migration extends \Test\TestCase { class AmazonS3Migration extends \Test\TestCase {
/** /**

View File

@ -25,6 +25,13 @@
namespace Test\Files\Storage; namespace Test\Files\Storage;
/**
* Class AmazonS3
*
* @group DB
*
* @package Test\Files\Storage
*/
class AmazonS3 extends Storage { class AmazonS3 extends Storage {
private $config; private $config;

View File

@ -25,6 +25,13 @@
namespace Test\Files\Storage; namespace Test\Files\Storage;
/**
* Class Dropbox
*
* @group DB
*
* @package Test\Files\Storage
*/
class Dropbox extends Storage { class Dropbox extends Storage {
private $config; private $config;

View File

@ -26,6 +26,13 @@
namespace Test\Files\Storage; namespace Test\Files\Storage;
/**
* Class FTP
*
* @group DB
*
* @package Test\Files\Storage
*/
class FTP extends Storage { class FTP extends Storage {
private $config; private $config;

View File

@ -28,6 +28,13 @@ namespace Test\Files\Storage;
require_once 'files_external/lib/google.php'; require_once 'files_external/lib/google.php';
/**
* Class Google
*
* @group DB
*
* @package Test\Files\Storage
*/
class Google extends Storage { class Google extends Storage {
private $config; private $config;

View File

@ -23,6 +23,13 @@
namespace Test\Files\Storage; namespace Test\Files\Storage;
/**
* Class OwnCloud
*
* @group DB
*
* @package Test\Files\Storage
*/
class OwnCloud extends Storage { class OwnCloud extends Storage {
private $config; private $config;

View File

@ -25,6 +25,13 @@
namespace Test\Files\Storage; namespace Test\Files\Storage;
/**
* Class SFTP
*
* @group DB
*
* @package Test\Files\Storage
*/
class SFTP extends Storage { class SFTP extends Storage {
/** /**
* @var \OC\Files\Storage\SFTP instance * @var \OC\Files\Storage\SFTP instance

View File

@ -23,6 +23,13 @@
namespace Test\Files\Storage; namespace Test\Files\Storage;
/**
* Class SFTP_Key
*
* @group DB
*
* @package Test\Files\Storage
*/
class SFTP_Key extends Storage { class SFTP_Key extends Storage {
private $config; private $config;

View File

@ -24,6 +24,13 @@
namespace Test\Files\Storage; namespace Test\Files\Storage;
/**
* Class SMB
*
* @group DB
*
* @package Test\Files\Storage
*/
class SMB extends Storage { class SMB extends Storage {
protected function setUp() { protected function setUp() {

View File

@ -25,6 +25,13 @@
namespace Test\Files\Storage; namespace Test\Files\Storage;
/**
* Class Swift
*
* @group DB
*
* @package Test\Files\Storage
*/
class Swift extends Storage { class Swift extends Storage {
private $config; private $config;

View File

@ -24,6 +24,13 @@
namespace Test\Files\Storage; namespace Test\Files\Storage;
/**
* Class DAV
*
* @group DB
*
* @package Test\Files\Storage
*/
class DAV extends Storage { class DAV extends Storage {
protected function setUp() { protected function setUp() {

View File

@ -26,6 +26,13 @@ namespace Tests\Files_External;
use OC\Files\Filesystem; use OC\Files\Filesystem;
use OC\User\User; use OC\User\User;
/**
* Class EtagPropagator
*
* @group DB
*
* @package Tests\Files_External
*/
class EtagPropagator extends \Test\TestCase { class EtagPropagator extends \Test\TestCase {
protected function getUser() { protected function getUser() {
return new User($this->getUniqueID(), null); return new User($this->getUniqueID(), null);

View File

@ -24,6 +24,13 @@
namespace Test\Files\Storage; namespace Test\Files\Storage;
/**
* Class OwnCloudFunctions
*
* @group DB
*
* @package Test\Files\Storage
*/
class OwnCloudFunctions extends \Test\TestCase { class OwnCloudFunctions extends \Test\TestCase {
function configUrlProvider() { function configUrlProvider() {

View File

@ -22,10 +22,15 @@
*/ */
namespace OCA\Files_sharing\Tests; namespace OCA\Files_sharing\Tests;
use OCA\Files_sharing\Tests\TestCase;
/**
class Activity extends \OCA\Files_Sharing\Tests\TestCase{ * Class Activity
*
* @group DB
*
* @package OCA\Files_sharing\Tests
*/
class Activity extends \OCA\Files_Sharing\Tests\TestCase {
/** /**
* @var \OCA\Files_Sharing\Activity * @var \OCA\Files_Sharing\Activity

View File

@ -31,6 +31,8 @@ use OCA\Files_sharing\Tests\TestCase;
/** /**
* Class Test_Files_Sharing_Api * Class Test_Files_Sharing_Api
*
* @group DB
*/ */
class Test_Files_Sharing_Api extends TestCase { class Test_Files_Sharing_Api extends TestCase {

View File

@ -27,6 +27,13 @@ use OCA\Files_sharing\Tests\TestCase;
use OCP\AppFramework\Http; use OCP\AppFramework\Http;
use OCP\Share; use OCP\Share;
/**
* Class ShareesTest
*
* @group DB
*
* @package OCA\Files_Sharing\Tests\API
*/
class ShareesTest extends TestCase { class ShareesTest extends TestCase {
/** @var Sharees */ /** @var Sharees */
protected $sharees; protected $sharees;

View File

@ -27,6 +27,8 @@ use OCA\Files_sharing\Tests\TestCase;
/** /**
* Class Test_Files_Sharing * Class Test_Files_Sharing
*
* @group DB
*/ */
class Test_Files_Sharing_Backend extends TestCase { class Test_Files_Sharing_Backend extends TestCase {

View File

@ -47,6 +47,12 @@ use OCA\Files_sharing\Tests\TestCase;
* License along with this library. If not, see <http://www.gnu.org/licenses/>. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
/**
* Class Test_Files_Sharing_Cache
*
* @group DB
*/
class Test_Files_Sharing_Cache extends TestCase { class Test_Files_Sharing_Cache extends TestCase {
/** /**

View File

@ -26,6 +26,8 @@ use OCA\Files_Sharing\Tests\TestCase;
/** /**
* Class FilesSharingCapabilitiesTest * Class FilesSharingCapabilitiesTest
*
* @group DB
*/ */
class FilesSharingCapabilitiesTest extends \Test\TestCase { class FilesSharingCapabilitiesTest extends \Test\TestCase {

View File

@ -38,6 +38,8 @@ use OCP\Share;
use OC\URLGenerator; use OC\URLGenerator;
/** /**
* @group DB
*
* @package OCA\Files_Sharing\Controllers * @package OCA\Files_Sharing\Controllers
*/ */
class ShareControllerTest extends \Test\TestCase { class ShareControllerTest extends \Test\TestCase {

View File

@ -23,6 +23,13 @@ namespace Test\BackgroundJob;
use OCA\Files_sharing\Lib\DeleteOrphanedSharesJob; use OCA\Files_sharing\Lib\DeleteOrphanedSharesJob;
/**
* Class DeleteOrphanedSharesJobTest
*
* @group DB
*
* @package Test\BackgroundJob
*/
class DeleteOrphanedSharesJobTest extends \Test\TestCase { class DeleteOrphanedSharesJobTest extends \Test\TestCase {
/** /**

View File

@ -27,6 +27,13 @@ namespace OCA\Files_sharing\Tests;
use OC\Files\Filesystem; use OC\Files\Filesystem;
use OC\Files\View; use OC\Files\View;
/**
* Class EtagPropagation
*
* @group DB
*
* @package OCA\Files_sharing\Tests
*/
class EtagPropagation extends TestCase { class EtagPropagation extends TestCase {
/** /**
* @var \OC\Files\View * @var \OC\Files\View

View File

@ -23,6 +23,13 @@ namespace OCA\Files_Sharing\Tests;
use OCA\Files_Sharing\ExpireSharesJob; use OCA\Files_Sharing\ExpireSharesJob;
/**
* Class ExpireSharesJobTest
*
* @group DB
*
* @package OCA\Files_Sharing\Tests
*/
class ExpireSharesJobTest extends \Test\TestCase { class ExpireSharesJobTest extends \Test\TestCase {
/** /**

View File

@ -23,24 +23,11 @@ namespace OCA\Files_sharing\Tests\External;
use OCA\Files_sharing\Tests\TestCase; use OCA\Files_sharing\Tests\TestCase;
/** /**
* ownCloud * Class Cache
* *
* @author Vincent Petry * @group DB
* @copyright 2015 Vincent Petry <pvince81@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library 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 along with this library. If not, see <http://www.gnu.org/licenses/>.
* *
* @package OCA\Files_sharing\Tests\External
*/ */
class Cache extends TestCase { class Cache extends TestCase {

View File

@ -28,6 +28,13 @@ use OCA\Files_Sharing\External\MountProvider;
use OCA\Files_Sharing\Tests\TestCase; use OCA\Files_Sharing\Tests\TestCase;
use Test\Traits\UserTrait; use Test\Traits\UserTrait;
/**
* Class ManagerTest
*
* @group DB
*
* @package OCA\Files_Sharing\Tests\External
*/
class ManagerTest extends TestCase { class ManagerTest extends TestCase {
use UserTrait; use UserTrait;

View File

@ -24,6 +24,8 @@
/** /**
* Tests for the external Storage class for remote shares. * Tests for the external Storage class for remote shares.
*
* @group DB
*/ */
class Test_Files_Sharing_External_Storage extends \Test\TestCase { class Test_Files_Sharing_External_Storage extends \Test\TestCase {

View File

@ -24,26 +24,10 @@
use OCA\Files_sharing\Tests\TestCase; use OCA\Files_sharing\Tests\TestCase;
/** /**
* ownCloud * Class Test_Files_Sharing_Helper
*
* @author Bjoern Schiessle
* @copyright 2014 Bjoern Schiessle <schiessle@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library 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 along with this library. If not, see <http://www.gnu.org/licenses/>.
* *
* @group DB
*/ */
class Test_Files_Sharing_Helper extends TestCase { class Test_Files_Sharing_Helper extends TestCase {
/** /**

View File

@ -27,6 +27,13 @@ use OC\Files\View;
use OC\Lock\MemcacheLockingProvider; use OC\Lock\MemcacheLockingProvider;
use OCP\Lock\ILockingProvider; use OCP\Lock\ILockingProvider;
/**
* Class Locking
*
* @group DB
*
* @package OCA\Files_sharing\Tests
*/
class Locking extends TestCase { class Locking extends TestCase {
/** /**
* @var \Test\Util\User\Dummy * @var \Test\Util\User\Dummy

View File

@ -24,6 +24,11 @@
use OCA\Files_Sharing\Tests\TestCase; use OCA\Files_Sharing\Tests\TestCase;
use OCA\Files_Sharing\Migration; use OCA\Files_Sharing\Migration;
/**
* Class MigrationTest
*
* @group DB
*/
class MigrationTest extends TestCase { class MigrationTest extends TestCase {
/** /**

View File

@ -26,7 +26,11 @@ use OC\Files\Cache\Cache;
use OC\Files\Storage\Storage; use OC\Files\Storage\Storage;
use OC\Files\View; use OC\Files\View;
/**
* Class Test_Files_Sharing_Permissions
*
* @group DB
*/
class Test_Files_Sharing_Permissions extends OCA\Files_sharing\Tests\TestCase { class Test_Files_Sharing_Permissions extends OCA\Files_sharing\Tests\TestCase {
/** /**

View File

@ -26,6 +26,8 @@ use OCA\Files_Sharing\Tests\TestCase;
/** /**
* Class Test_Files_Sharing_Api * Class Test_Files_Sharing_Api
*
* @group DB
*/ */
class Test_Files_Sharing_S2S_OCS_API extends TestCase { class Test_Files_Sharing_S2S_OCS_API extends TestCase {

View File

@ -27,6 +27,8 @@ use OCA\Files\Share;
/** /**
* Class Test_Files_Sharing * Class Test_Files_Sharing
*
* @group DB
*/ */
class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase { class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase {

View File

@ -27,6 +27,8 @@
/** /**
* Class Test_Files_Sharing_Api * Class Test_Files_Sharing_Api
*
* @group DB
*/ */
class Test_Files_Sharing_Mount extends OCA\Files_sharing\Tests\TestCase { class Test_Files_Sharing_Mount extends OCA\Files_sharing\Tests\TestCase {

View File

@ -28,6 +28,8 @@ use OCA\Files\Share;
/** /**
* Class Test_Files_Sharing_Api * Class Test_Files_Sharing_Api
*
* @group DB
*/ */
class Test_Files_Sharing_Storage extends OCA\Files_sharing\Tests\TestCase { class Test_Files_Sharing_Storage extends OCA\Files_sharing\Tests\TestCase {

View File

@ -24,6 +24,13 @@ namespace OCA\Files_sharing\Tests;
use OC\Files\View; use OC\Files\View;
/**
* Class SizePropagation
*
* @group DB
*
* @package OCA\Files_sharing\Tests
*/
class SizePropagation extends TestCase { class SizePropagation extends TestCase {
public function testSizePropagationWhenOwnerChangesFile() { public function testSizePropagationWhenOwnerChangesFile() {

View File

@ -36,6 +36,8 @@ use OCA\Files_Sharing\Appinfo\Application;
/** /**
* Class Test_Files_Sharing_Base * Class Test_Files_Sharing_Base
* *
* @group DB
*
* Base class for sharing tests. * Base class for sharing tests.
*/ */
abstract class TestCase extends \Test\TestCase { abstract class TestCase extends \Test\TestCase {

View File

@ -26,6 +26,13 @@ namespace OCA\Files_sharing\Tests;
use OCA\Files\Share; use OCA\Files\Share;
/**
* Class UnshareChildren
*
* @group DB
*
* @package OCA\Files_sharing\Tests
*/
class UnshareChildren extends TestCase { class UnshareChildren extends TestCase {
protected $subsubfolder; protected $subsubfolder;

View File

@ -25,6 +25,8 @@
/** /**
* Class Test_Files_Sharing_Updater * Class Test_Files_Sharing_Updater
*
* @group DB
*/ */
class Test_Files_Sharing_Updater extends OCA\Files_Sharing\Tests\TestCase { class Test_Files_Sharing_Updater extends OCA\Files_Sharing\Tests\TestCase {

View File

@ -25,6 +25,11 @@
* *
*/ */
/**
* Class Test_Files_Sharing_Watcher
*
* @group DB
*/
class Test_Files_Sharing_Watcher extends OCA\Files_sharing\Tests\TestCase { class Test_Files_Sharing_Watcher extends OCA\Files_sharing\Tests\TestCase {
/** /**

View File

@ -29,6 +29,13 @@ use Test\TestCase;
use OC\User\Manager; use OC\User\Manager;
use OCP\Files\IRootFolder; use OCP\Files\IRootFolder;
/**
* Class CleanUpTest
*
* @group DB
*
* @package OCA\Files_Trashbin\Tests\Command
*/
class CleanUpTest extends TestCase { class CleanUpTest extends TestCase {
/** @var CleanUp */ /** @var CleanUp */

View File

@ -24,6 +24,13 @@ namespace OCA\Files_Trashbin\Tests\Command;
use OCA\Files_Trashbin\Command\Expire; use OCA\Files_Trashbin\Command\Expire;
use Test\TestCase; use Test\TestCase;
/**
* Class ExpireTest
*
* @group DB
*
* @package OCA\Files_Trashbin\Tests\Command
*/
class ExpireTest extends TestCase { class ExpireTest extends TestCase {
public function testExpireNonExistingUser() { public function testExpireNonExistingUser() {
$command = new Expire('test'); $command = new Expire('test');

View File

@ -27,6 +27,13 @@ namespace OCA\Files_trashbin\Tests\Storage;
use OC\Files\Storage\Temporary; use OC\Files\Storage\Temporary;
use OC\Files\Filesystem; use OC\Files\Filesystem;
/**
* Class Storage
*
* @group DB
*
* @package OCA\Files_trashbin\Tests\Storage
*/
class Storage extends \Test\TestCase { class Storage extends \Test\TestCase {
/** /**
* @var string * @var string

View File

@ -29,6 +29,8 @@ use OCA\Files_Trashbin;
/** /**
* Class Test_Encryption * Class Test_Encryption
*
* @group DB
*/ */
class Test_Trashbin extends \Test\TestCase { class Test_Trashbin extends \Test\TestCase {

View File

@ -28,6 +28,13 @@ use Test\TestCase;
use OC\User\Manager; use OC\User\Manager;
use OCP\Files\IRootFolder; use OCP\Files\IRootFolder;
/**
* Class CleanupTest
*
* @group DB
*
* @package OCA\Files_Versions\Tests\Command
*/
class CleanupTest extends TestCase { class CleanupTest extends TestCase {
/** @var CleanUp */ /** @var CleanUp */

View File

@ -25,6 +25,13 @@ namespace OCA\Files_Versions\Tests\Command;
use OCA\Files_Versions\Command\Expire; use OCA\Files_Versions\Command\Expire;
use Test\TestCase; use Test\TestCase;
/**
* Class ExpireTest
*
* @group DB
*
* @package OCA\Files_Versions\Tests\Command
*/
class ExpireTest extends TestCase { class ExpireTest extends TestCase {
public function testExpireNonExistingUser() { public function testExpireNonExistingUser() {
$command = new Expire($this->getUniqueID('test'), ''); $command = new Expire($this->getUniqueID('test'), '');

View File

@ -34,6 +34,8 @@ use OC\Files\Storage\Temporary;
/** /**
* Class Test_Files_versions * Class Test_Files_versions
* this class provide basic files versions test * this class provide basic files versions test
*
* @group DB
*/ */
class Test_Files_Versioning extends \Test\TestCase { class Test_Files_Versioning extends \Test\TestCase {

View File

@ -23,15 +23,35 @@
*/ */
namespace OCA\Provisioning_API\Tests; namespace OCA\Provisioning_API\Tests;
use OCA\Provisioning_API\Apps;
use OCP\API;
use OCP\App\IAppManager;
use OCP\IUserSession;
/**
* Class AppsTest
*
* @group DB
*
* @package OCA\Provisioning_API\Tests
*/
class AppsTest extends TestCase { class AppsTest extends TestCase {
/** @var IAppManager */
private $appManager;
/** @var Apps */
private $api;
/** @var IUserSession */
private $userSession;
public function setup() { public function setup() {
parent::setup(); parent::setup();
$this->appManager = \OC::$server->getAppManager(); $this->appManager = \OC::$server->getAppManager();
$this->groupManager = \OC::$server->getGroupManager(); $this->groupManager = \OC::$server->getGroupManager();
$this->userSession = \OC::$server->getUserSession(); $this->userSession = \OC::$server->getUserSession();
$this->api = new \OCA\Provisioning_API\Apps($this->appManager); $this->api = new Apps($this->appManager);
} }
public function testGetAppInfo() { public function testGetAppInfo() {
@ -46,7 +66,7 @@ class AppsTest extends TestCase {
$result = $this->api->getAppInfo(['appid' => 'not_provisioning_api']); $result = $this->api->getAppInfo(['appid' => 'not_provisioning_api']);
$this->assertInstanceOf('OC_OCS_Result', $result); $this->assertInstanceOf('OC_OCS_Result', $result);
$this->assertFalse($result->succeeded()); $this->assertFalse($result->succeeded());
$this->assertEquals(\OCP\API::RESPOND_NOT_FOUND, $result->getStatusCode()); $this->assertEquals(API::RESPOND_NOT_FOUND, $result->getStatusCode());
} }

View File

@ -23,10 +23,13 @@
namespace OCA\Provisioning_API\Tests; namespace OCA\Provisioning_API\Tests;
use OCP\IUser;
use OCP\IUserManager; use OCP\IUserManager;
use OCP\IGroupManager; use OCP\IGroupManager;
abstract class TestCase extends \Test\TestCase { abstract class TestCase extends \Test\TestCase {
/** @var IUser[] */
protected $users = array(); protected $users = array();
/** @var IUserManager */ /** @var IUserManager */
@ -46,7 +49,7 @@ abstract class TestCase extends \Test\TestCase {
/** /**
* Generates a temp user * Generates a temp user
* @param int $num number of users to generate * @param int $num number of users to generate
* @return IUser[]|Iuser * @return IUser[]|IUser
*/ */
protected function generateUsers($num = 1) { protected function generateUsers($num = 1) {
$users = array(); $users = array();

View File

@ -28,6 +28,13 @@ use \OCA\user_ldap\lib\Access;
use \OCA\user_ldap\lib\Connection; use \OCA\user_ldap\lib\Connection;
use \OCA\user_ldap\lib\ILDAPWrapper; use \OCA\user_ldap\lib\ILDAPWrapper;
/**
* Class Test_Access
*
* @group DB
*
* @package OCA\user_ldap\tests
*/
class Test_Access extends \Test\TestCase { class Test_Access extends \Test\TestCase {
private function getConnectorAndLdapMock() { private function getConnectorAndLdapMock() {
static $conMethods; static $conMethods;

View File

@ -23,6 +23,13 @@
namespace OCA\user_ldap\tests; namespace OCA\user_ldap\tests;
/**
* Class Test_Connection
*
* @group DB
*
* @package OCA\user_ldap\tests
*/
class Test_Connection extends \Test\TestCase { class Test_Connection extends \Test\TestCase {
public function testOriginalAgentUnchangedOnClone() { public function testOriginalAgentUnchangedOnClone() {
@ -52,4 +59,4 @@ class Test_Connection extends \Test\TestCase {
$this->assertSame($agentPawd, $agent['ldapAgentPassword']); $this->assertSame($agentPawd, $agent['ldapAgentPassword']);
} }
} }

View File

@ -30,6 +30,13 @@ use \OCA\user_ldap\lib\Access;
use \OCA\user_ldap\lib\Connection; use \OCA\user_ldap\lib\Connection;
use \OCA\user_ldap\lib\ILDAPWrapper; use \OCA\user_ldap\lib\ILDAPWrapper;
/**
* Class Test_Group_Ldap
*
* @group DB
*
* @package OCA\user_ldap\tests
*/
class Test_Group_Ldap extends \Test\TestCase { class Test_Group_Ldap extends \Test\TestCase {
private function getAccessMock() { private function getAccessMock() {
static $conMethods; static $conMethods;

View File

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

View File

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

View File

@ -26,6 +26,13 @@ namespace OCA\user_ldap\tests;
use OCA\user_ldap\lib\user\Manager; use OCA\user_ldap\lib\user\Manager;
/**
* Class Test_User_Manager
*
* @group DB
*
* @package OCA\user_ldap\tests
*/
class Test_User_Manager extends \Test\TestCase { class Test_User_Manager extends \Test\TestCase {
private function getTestInstances() { private function getTestInstances() {

View File

@ -25,6 +25,13 @@ namespace OCA\user_ldap\tests;
use OCA\user_ldap\lib\user\User; use OCA\user_ldap\lib\user\User;
/**
* Class Test_User_User
*
* @group DB
*
* @package OCA\user_ldap\tests
*/
class Test_User_User extends \Test\TestCase { class Test_User_User extends \Test\TestCase {
private function getTestInstances() { private function getTestInstances() {

View File

@ -31,6 +31,13 @@ use \OCA\user_ldap\lib\Access;
use \OCA\user_ldap\lib\Connection; use \OCA\user_ldap\lib\Connection;
use \OCA\user_ldap\lib\ILDAPWrapper; use \OCA\user_ldap\lib\ILDAPWrapper;
/**
* Class Test_User_Ldap_Direct
*
* @group DB
*
* @package OCA\user_ldap\tests
*/
class Test_User_Ldap_Direct extends \Test\TestCase { class Test_User_Ldap_Direct extends \Test\TestCase {
protected $backend; protected $backend;
protected $access; protected $access;

View File

@ -31,6 +31,13 @@ use \OCA\user_ldap\lib\Wizard;
// use \OCA\user_ldap\lib\Configuration; // use \OCA\user_ldap\lib\Configuration;
// use \OCA\user_ldap\lib\ILDAPWrapper; // use \OCA\user_ldap\lib\ILDAPWrapper;
/**
* Class Test_Wizard
*
* @group DB
*
* @package OCA\user_ldap\tests
*/
class Test_Wizard extends \Test\TestCase { class Test_Wizard extends \Test\TestCase {
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();

View File

@ -260,14 +260,23 @@ function execute_tests {
if [[ "$_XDEBUG_CONFIG" ]]; then if [[ "$_XDEBUG_CONFIG" ]]; then
export XDEBUG_CONFIG=$_XDEBUG_CONFIG export XDEBUG_CONFIG=$_XDEBUG_CONFIG
fi fi
GROUP=''
if [ "$TEST_SELECTION" == "DB" ]; then
GROUP='--group DB'
fi
if [ "$TEST_SELECTION" == "NODB" ]; then
GROUP='--exclude-group DB'
fi
COVER=''
if [ -z "$NOCOVERAGE" ]; then if [ -z "$NOCOVERAGE" ]; then
"${PHPUNIT[@]}" --configuration phpunit-autotest.xml --log-junit "autotest-results-$DB.xml" --coverage-clover "autotest-clover-$DB.xml" --coverage-html "coverage-html-$DB" "$2" "$3" COVER='--coverage-clover "autotest-clover-$DB.xml" --coverage-html "coverage-html-$DB"'
RESULT=$?
else else
echo "No coverage" echo "No coverage"
"${PHPUNIT[@]}" --configuration phpunit-autotest.xml --log-junit "autotest-results-$DB.xml" "$2" "$3"
RESULT=$?
fi fi
echo "${PHPUNIT[@]}" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3"
"${PHPUNIT[@]}" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3"
RESULT=$?
if [ "$PRIMARY_STORAGE_CONFIG" == "swift" ] ; then if [ "$PRIMARY_STORAGE_CONFIG" == "swift" ] ; then
cd .. cd ..

View File

@ -105,6 +105,7 @@ class DAV extends Common {
$this->secure = false; $this->secure = false;
} }
if ($this->secure === true) { if ($this->secure === true) {
// inject mock for testing
$certPath = \OC_User::getHome(\OC_User::getUser()) . '/files_external/rootcerts.crt'; $certPath = \OC_User::getHome(\OC_User::getUser()) . '/files_external/rootcerts.crt';
if (file_exists($certPath)) { if (file_exists($certPath)) {
$this->certPath = $certPath; $this->certPath = $certPath;

View File

@ -62,6 +62,7 @@ class URLGenerator implements IURLGenerator {
* Returns a url to the given route. * Returns a url to the given route.
*/ */
public function linkToRoute($route, $parameters = array()) { public function linkToRoute($route, $parameters = array()) {
// TODO: mock router
$urlLinkTo = \OC::$server->getRouter()->generate($route, $parameters); $urlLinkTo = \OC::$server->getRouter()->generate($route, $parameters);
return $urlLinkTo; return $urlLinkTo;
} }

View File

@ -44,6 +44,8 @@ function is_uploaded_file($filename) {
/** /**
* Class AvatarControllerTest * Class AvatarControllerTest
* *
* @group DB
*
* @package OC\Core\Avatar * @package OC\Core\Avatar
*/ */
class AvatarControllerTest extends \Test\TestCase { class AvatarControllerTest extends \Test\TestCase {

View File

@ -8,6 +8,13 @@
namespace Test; namespace Test;
/**
* Class TestAllConfig
*
* @group DB
*
* @package Test
*/
class TestAllConfig extends \Test\TestCase { class TestAllConfig extends \Test\TestCase {
/** @var \OCP\IDBConnection */ /** @var \OCP\IDBConnection */

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* Copyright (c) 2012 Bernhard Posselt <dev@bernhard-posselt.com> * Copyright (c) 2012 Bernhard Posselt <dev@bernhard-posselt.com>
* Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com> * Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com>
@ -7,6 +6,12 @@
* later. * later.
* See the COPYING-README file. * See the COPYING-README file.
*/ */
/**
* Class Test_App
*
* @group DB
*/
class Test_App extends \Test\TestCase { class Test_App extends \Test\TestCase {
const TEST_USER1 = 'user1'; const TEST_USER1 = 'user1';

View File

@ -11,6 +11,13 @@ namespace Test\Lib;
use Test\TestCase; use Test\TestCase;
/**
* Class AppConfig
*
* @group DB
*
* @package Test\Lib
*/
class AppConfig extends TestCase { class AppConfig extends TestCase {
/** @var \OCP\IAppConfig */ /** @var \OCP\IAppConfig */
protected $appConfig; protected $appConfig;

View File

@ -128,6 +128,7 @@ class AppTest extends \Test\TestCase {
protected function tearDown() { protected function tearDown() {
rrmdir($this->appPath); rrmdir($this->appPath);
parent::tearDown();
} }

View File

@ -36,7 +36,9 @@ class DIContainerTest extends \Test\TestCase {
protected function setUp(){ protected function setUp(){
parent::setUp(); parent::setUp();
$this->container = new DIContainer('name'); $this->container = $this->getMock('OC\AppFramework\DependencyInjection\DIContainer',
['isAdminUser'], ['name']
);
$this->api = $this->getMock('OC\AppFramework\Core\API', array(), array('hi')); $this->api = $this->getMock('OC\AppFramework\Core\API', array(), array('hi'));
} }

View File

@ -9,6 +9,11 @@
use OC\Avatar; use OC\Avatar;
/**
* Class Test_Avatar
*
* @group DB
*/
class Test_Avatar extends \Test\TestCase { class Test_Avatar extends \Test\TestCase {
private static $trashBinStatus; private static $trashBinStatus;

View File

@ -9,8 +9,16 @@
namespace Test\BackgroundJob; namespace Test\BackgroundJob;
use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\IJob;
use Test\TestCase;
class JobList extends \Test\TestCase { /**
* Class JobList
*
* @group DB
*
* @package Test\BackgroundJob
*/
class JobList extends TestCase {
/** /**
* @var \OC\BackgroundJob\JobList * @var \OC\BackgroundJob\JobList
*/ */

View File

@ -22,6 +22,13 @@
namespace Test\Cache; namespace Test\Cache;
/**
* Class FileCache
*
* @group DB
*
* @package Test\Cache
*/
class FileCache extends \Test_Cache { class FileCache extends \Test_Cache {
/** /**
* @var string * @var string

View File

@ -6,6 +6,11 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
/**
* Class Test_DB
*
* @group DB
*/
class Test_DB extends \Test\TestCase { class Test_DB extends \Test\TestCase {
protected $backupGlobals = FALSE; protected $backupGlobals = FALSE;

View File

@ -12,6 +12,13 @@ namespace Test\DB;
use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\DBAL\Platforms\SqlitePlatform;
use OC\DB\MDB2SchemaManager; use OC\DB\MDB2SchemaManager;
/**
* Class Connection
*
* @group DB
*
* @package Test\DB
*/
class Connection extends \Test\TestCase { class Connection extends \Test\TestCase {
/** /**
* @var \OCP\IDBConnection * @var \OCP\IDBConnection

View File

@ -11,6 +11,13 @@ namespace Test\DB;
use Doctrine\DBAL\Platforms\OraclePlatform; use Doctrine\DBAL\Platforms\OraclePlatform;
/**
* Class MDB2SchemaManager
*
* @group DB
*
* @package Test\DB
*/
class MDB2SchemaManager extends \Test\TestCase { class MDB2SchemaManager extends \Test\TestCase {
protected function tearDown() { protected function tearDown() {

View File

@ -15,6 +15,13 @@ use \Doctrine\DBAL\Schema\Schema;
use \Doctrine\DBAL\Schema\SchemaConfig; use \Doctrine\DBAL\Schema\SchemaConfig;
use OCP\IConfig; use OCP\IConfig;
/**
* Class Migrator
*
* @group DB
*
* @package Test\DB
*/
class Migrator extends \Test\TestCase { class Migrator extends \Test\TestCase {
/** /**
* @var \Doctrine\DBAL\Connection $connection * @var \Doctrine\DBAL\Connection $connection

View File

@ -6,6 +6,11 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
/**
* Class TestMySqlMigration
*
* @group DB
*/
class TestMySqlMigration extends \Test\TestCase { class TestMySqlMigration extends \Test\TestCase {
/** @var \Doctrine\DBAL\Connection */ /** @var \Doctrine\DBAL\Connection */

View File

@ -24,6 +24,13 @@ namespace Test\DB\QueryBuilder;
use Doctrine\DBAL\Query\Expression\ExpressionBuilder as DoctrineExpressionBuilder; use Doctrine\DBAL\Query\Expression\ExpressionBuilder as DoctrineExpressionBuilder;
use OC\DB\QueryBuilder\ExpressionBuilder; use OC\DB\QueryBuilder\ExpressionBuilder;
/**
* Class ExpressionBuilderTest
*
* @group DB
*
* @package Test\DB\QueryBuilder
*/
class ExpressionBuilderTest extends \Test\TestCase { class ExpressionBuilderTest extends \Test\TestCase {
/** @var ExpressionBuilder */ /** @var ExpressionBuilder */
protected $expressionBuilder; protected $expressionBuilder;

View File

@ -27,6 +27,13 @@ use OC\DB\QueryBuilder\Parameter;
use OC\DB\QueryBuilder\QueryBuilder; use OC\DB\QueryBuilder\QueryBuilder;
use OCP\IDBConnection; use OCP\IDBConnection;
/**
* Class QueryBuilderTest
*
* @group DB
*
* @package Test\DB\QueryBuilder
*/
class QueryBuilderTest extends \Test\TestCase { class QueryBuilderTest extends \Test\TestCase {
/** @var QueryBuilder */ /** @var QueryBuilder */
protected $queryBuilder; protected $queryBuilder;

View File

@ -6,6 +6,11 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
/**
* Class TestSqliteMigration
*
* @group DB
*/
class TestSqliteMigration extends \Test\TestCase { class TestSqliteMigration extends \Test\TestCase {
/** @var \Doctrine\DBAL\Connection */ /** @var \Doctrine\DBAL\Connection */

View File

@ -9,6 +9,11 @@
use OCP\Security\ISecureRandom; use OCP\Security\ISecureRandom;
/**
* Class Test_DBSchema
*
* @group DB
*/
class Test_DBSchema extends \Test\TestCase { class Test_DBSchema extends \Test\TestCase {
protected $schema_file = 'static://test_db_scheme'; protected $schema_file = 'static://test_db_scheme';
protected $schema_file2 = 'static://test_db_scheme2'; protected $schema_file2 = 'static://test_db_scheme2';

View File

@ -30,6 +30,13 @@ use OC\Files\View;
use OCP\IUserManager; use OCP\IUserManager;
use Test\TestCase; use Test\TestCase;
/**
* Class DecryptAllTest
*
* @group DB
*
* @package Test\Encryption
*/
class DecryptAllTest extends TestCase { class DecryptAllTest extends TestCase {
/** @var \PHPUnit_Framework_MockObject_MockObject | IUserManager */ /** @var \PHPUnit_Framework_MockObject_MockObject | IUserManager */

View File

@ -16,6 +16,13 @@ class LongId extends \OC\Files\Storage\Temporary {
} }
} }
/**
* Class Cache
*
* @group DB
*
* @package Test\Files\Cache
*/
class Cache extends \Test\TestCase { class Cache extends \Test\TestCase {
/** /**
* @var \OC\Files\Storage\Temporary $storage ; * @var \OC\Files\Storage\Temporary $storage ;

View File

@ -12,6 +12,13 @@ use OC\Files\Filesystem;
use OC\Files\Storage\Temporary; use OC\Files\Storage\Temporary;
use OC\Files\View; use OC\Files\View;
/**
* Class ChangePropagator
*
* @group DB
*
* @package Test\Files\Cache
*/
class ChangePropagator extends \Test\TestCase { class ChangePropagator extends \Test\TestCase {
/** /**
* @var \OC\Files\Cache\ChangePropagator * @var \OC\Files\Cache\ChangePropagator

View File

@ -43,6 +43,13 @@ class DummyUser extends \OC\User\User {
} }
} }
/**
* Class HomeCache
*
* @group DB
*
* @package Test\Files\Cache
*/
class HomeCache extends \Test\TestCase { class HomeCache extends \Test\TestCase {
/** /**
* @var \OC\Files\Storage\Home $storage * @var \OC\Files\Storage\Home $storage

View File

@ -8,6 +8,13 @@
namespace Test\Files\Cache; namespace Test\Files\Cache;
/**
* Class Scanner
*
* @group DB
*
* @package Test\Files\Cache
*/
class Scanner extends \Test\TestCase { class Scanner extends \Test\TestCase {
/** /**
* @var \OC\Files\Storage\Storage $storage * @var \OC\Files\Storage\Storage $storage

View File

@ -12,6 +12,13 @@ use OC\Files\Filesystem;
use OC\Files\Storage\Temporary; use OC\Files\Storage\Temporary;
use OC\Files\View; use OC\Files\View;
/**
* Class Updater
*
* @group DB
*
* @package Test\Files\Cache
*/
class Updater extends \Test\TestCase { class Updater extends \Test\TestCase {
/** /**
* @var \OC\Files\Storage\Storage * @var \OC\Files\Storage\Storage

View File

@ -12,6 +12,13 @@ use \OC\Files\Filesystem as Filesystem;
use OC\Files\Storage\Temporary; use OC\Files\Storage\Temporary;
use OC\Files\View; use OC\Files\View;
/**
* Class UpdaterLegacy
*
* @group DB
*
* @package Test\Files\Cache
*/
class UpdaterLegacy extends \Test\TestCase { class UpdaterLegacy extends \Test\TestCase {
/** /**
* @var \OC\Files\Storage\Storage $storage * @var \OC\Files\Storage\Storage $storage

View File

@ -8,6 +8,13 @@
namespace Test\Files\Cache; namespace Test\Files\Cache;
/**
* Class Watcher
*
* @group DB
*
* @package Test\Files\Cache
*/
class Watcher extends \Test\TestCase { class Watcher extends \Test\TestCase {
/** /**

View File

@ -10,6 +10,13 @@ namespace Test\Files\Cache\Wrapper;
use Test\Files\Cache\Cache; use Test\Files\Cache\Cache;
/**
* Class CacheJail
*
* @group DB
*
* @package Test\Files\Cache\Wrapper
*/
class CacheJail extends Cache { class CacheJail extends Cache {
/** /**
* @var \OC\Files\Cache\Cache $sourceCache * @var \OC\Files\Cache\Cache $sourceCache

View File

@ -11,6 +11,13 @@ namespace Test\Files\Cache\Wrapper;
use OCP\Constants; use OCP\Constants;
use Test\Files\Cache\Cache; use Test\Files\Cache\Cache;
/**
* Class CachePermissionsMask
*
* @group DB
*
* @package Test\Files\Cache\Wrapper
*/
class CachePermissionsMask extends Cache { class CachePermissionsMask extends Cache {
/** /**
* @var \OC\Files\Cache\Cache $sourceCache * @var \OC\Files\Cache\Cache $sourceCache

View File

@ -11,6 +11,13 @@ namespace Test\Files;
use OC\Files\Filesystem; use OC\Files\Filesystem;
use OCP\Share; use OCP\Share;
/**
* Class EtagTest
*
* @group DB
*
* @package Test\Files
*/
class EtagTest extends \Test\TestCase { class EtagTest extends \Test\TestCase {
private $datadir; private $datadir;

View File

@ -51,6 +51,13 @@ class DummyMountProvider implements IMountProvider {
} }
} }
/**
* Class Filesystem
*
* @group DB
*
* @package Test\Files
*/
class Filesystem extends \Test\TestCase { class Filesystem extends \Test\TestCase {
const TEST_FILESYSTEM_USER1 = "test-filesystem-user1"; const TEST_FILESYSTEM_USER1 = "test-filesystem-user1";

Some files were not shown because too many files have changed in this diff Show More