Merge pull request #12297 from owncloud/issue/10991-all-testcase
Issue/10991 all testcase
This commit is contained in:
commit
46e6104795
|
@ -21,7 +21,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase {
|
||||
class Test_OC_Files_App_Rename extends \Test\TestCase {
|
||||
private static $user;
|
||||
|
||||
/**
|
||||
|
@ -34,7 +34,6 @@ class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase {
|
|||
*/
|
||||
private $files;
|
||||
|
||||
/** @var \OC\Files\Storage\Storage */
|
||||
private $originalStorage;
|
||||
|
||||
protected function setUp() {
|
||||
|
|
|
@ -11,7 +11,7 @@ use OCA\Files;
|
|||
/**
|
||||
* Class Test_Files_Helper
|
||||
*/
|
||||
class Test_Files_Helper extends \PHPUnit_Framework_TestCase {
|
||||
class Test_Files_Helper extends \Test\TestCase {
|
||||
|
||||
private function makeFileInfo($name, $size, $mtime, $isDir = false) {
|
||||
return new \OC\Files\FileInfo(
|
||||
|
@ -90,7 +90,7 @@ class Test_Files_Helper extends \PHPUnit_Framework_TestCase {
|
|||
$this->assertEquals(
|
||||
$expectedOrder,
|
||||
$fileNames
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,16 +23,20 @@
|
|||
use OCA\Encryption;
|
||||
use OCA\Files_Encryption\Migration;
|
||||
|
||||
class Test_Migration extends PHPUnit_Framework_TestCase {
|
||||
class Test_Migration extends \Test\TestCase {
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
if (OC_DB::tableExists('encryption_test')) {
|
||||
OC_DB::dropTable('encryption_test');
|
||||
}
|
||||
$this->assertTableNotExist('encryption_test');
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
if (OC_DB::tableExists('encryption_test')) {
|
||||
OC_DB::dropTable('encryption_test');
|
||||
}
|
||||
|
|
|
@ -28,7 +28,9 @@ class AmazonS3 extends Storage {
|
|||
|
||||
private $config;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->config = include('files_external/tests/config.php');
|
||||
if ( ! is_array($this->config) or ! isset($this->config['amazons3']) or ! $this->config['amazons3']['run']) {
|
||||
$this->markTestSkipped('AmazonS3 backend not configured');
|
||||
|
@ -36,10 +38,12 @@ class AmazonS3 extends Storage {
|
|||
$this->instance = new \OC\Files\Storage\AmazonS3($this->config['amazons3']);
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
if ($this->instance) {
|
||||
$this->instance->rmdir('');
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testStat() {
|
||||
|
|
|
@ -23,15 +23,26 @@
|
|||
|
||||
namespace Test\Files\Storage;
|
||||
|
||||
class AmazonS3Migration extends \PHPUnit_Framework_TestCase {
|
||||
class AmazonS3Migration extends \Test\TestCase {
|
||||
|
||||
/**
|
||||
* @var \OC\Files\Storage\Storage instance
|
||||
*/
|
||||
protected $instance;
|
||||
|
||||
public function setUp () {
|
||||
$uuid = uniqid();
|
||||
/** @var array */
|
||||
protected $params;
|
||||
|
||||
/** @var string */
|
||||
protected $oldId;
|
||||
|
||||
/** @var string */
|
||||
protected $newId;
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$uuid = $this->getUniqueID();
|
||||
|
||||
$this->params['key'] = 'key'.$uuid;
|
||||
$this->params['secret'] = 'secret'.$uuid;
|
||||
|
@ -41,9 +52,11 @@ class AmazonS3Migration extends \PHPUnit_Framework_TestCase {
|
|||
$this->newId = 'amazon::' . $this->params['bucket'];
|
||||
}
|
||||
|
||||
public function tearDown () {
|
||||
protected function tearDown() {
|
||||
$this->deleteStorage($this->oldId);
|
||||
$this->deleteStorage($this->newId);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testUpdateLegacyOnlyId () {
|
||||
|
|
|
@ -11,8 +11,10 @@ namespace Test\Files\Storage;
|
|||
class Dropbox extends Storage {
|
||||
private $config;
|
||||
|
||||
public function setUp() {
|
||||
$id = uniqid();
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$id = $this->getUniqueID();
|
||||
$this->config = include('files_external/tests/config.php');
|
||||
if ( ! is_array($this->config) or ! isset($this->config['dropbox']) or ! $this->config['dropbox']['run']) {
|
||||
$this->markTestSkipped('Dropbox backend not configured');
|
||||
|
@ -21,6 +23,14 @@ class Dropbox extends Storage {
|
|||
$this->instance = new \OC\Files\Storage\Dropbox($this->config['dropbox']);
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
if ($this->instance) {
|
||||
$this->instance->unlink('/');
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function directoryProvider() {
|
||||
// doesn't support leading/trailing spaces
|
||||
return array(array('folder'));
|
||||
|
@ -36,10 +46,4 @@ class Dropbox extends Storage {
|
|||
// false because not supported
|
||||
$this->assertFalse($this->instance->touch('foo'));
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
if ($this->instance) {
|
||||
$this->instance->unlink('/');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ class Test_Mount_Config_Dummy_Backend {
|
|||
/**
|
||||
* Class Test_Dynamic_Mount_Config
|
||||
*/
|
||||
class Test_Dynamic_Mount_Config extends \PHPUnit_Framework_TestCase {
|
||||
class Test_Dynamic_Mount_Config extends \Test\TestCase {
|
||||
|
||||
private $backup;
|
||||
|
||||
|
@ -82,6 +82,7 @@ class Test_Dynamic_Mount_Config extends \PHPUnit_Framework_TestCase {
|
|||
}
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->backup = OC_Mount_Config::setUp();
|
||||
|
||||
|
@ -97,5 +98,6 @@ class Test_Dynamic_Mount_Config extends \PHPUnit_Framework_TestCase {
|
|||
protected function tearDown()
|
||||
{
|
||||
OC_Mount_Config::setUp($this->backup);
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,9 +11,9 @@ namespace Tests\Files_External;
|
|||
use OC\Files\Filesystem;
|
||||
use OC\User\User;
|
||||
|
||||
class EtagPropagator extends \PHPUnit_Framework_TestCase {
|
||||
class EtagPropagator extends \Test\TestCase {
|
||||
protected function getUser() {
|
||||
return new User(uniqid(), null);
|
||||
return new User($this->getUniqueID(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,8 +11,10 @@ namespace Test\Files\Storage;
|
|||
class FTP extends Storage {
|
||||
private $config;
|
||||
|
||||
public function setUp() {
|
||||
$id = uniqid();
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$id = $this->getUniqueID();
|
||||
$this->config = include('files_external/tests/config.php');
|
||||
if ( ! is_array($this->config) or ! isset($this->config['ftp']) or ! $this->config['ftp']['run']) {
|
||||
$this->markTestSkipped('FTP backend not configured');
|
||||
|
@ -22,10 +24,12 @@ class FTP extends Storage {
|
|||
$this->instance->mkdir('/');
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
if ($this->instance) {
|
||||
\OCP\Files::rmdirr($this->instance->constructUrl(''));
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testConstructUrl(){
|
||||
|
|
|
@ -28,6 +28,8 @@ class Google extends Storage {
|
|||
private $config;
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->config = include('files_external/tests/config.php');
|
||||
if (!is_array($this->config) || !isset($this->config['google'])
|
||||
|| !$this->config['google']['run']
|
||||
|
@ -41,5 +43,7 @@ class Google extends Storage {
|
|||
if ($this->instance) {
|
||||
$this->instance->rmdir('/');
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ class Test_Mount_Config_Hook_Test {
|
|||
/**
|
||||
* Class Test_Mount_Config
|
||||
*/
|
||||
class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
|
||||
class Test_Mount_Config extends \Test\TestCase {
|
||||
|
||||
private $dataDir;
|
||||
private $userHome;
|
||||
|
@ -79,7 +79,9 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
|
|||
const TEST_GROUP2 = 'group2';
|
||||
const TEST_GROUP2B = 'group2b';
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
\OC_User::createUser(self::TEST_USER1, self::TEST_USER1);
|
||||
\OC_User::createUser(self::TEST_USER2, self::TEST_USER2);
|
||||
|
||||
|
@ -116,7 +118,7 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
|
|||
Test_Mount_Config_Hook_Test::setupHooks();
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
Test_Mount_Config_Hook_Test::clear();
|
||||
OC_Mount_Config::$skipTest = false;
|
||||
|
||||
|
@ -134,6 +136,8 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
|
|||
'user_mounting_backends',
|
||||
$this->oldAllowedBackends
|
||||
);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,8 +12,10 @@ class OwnCloud extends Storage {
|
|||
|
||||
private $config;
|
||||
|
||||
public function setUp() {
|
||||
$id = uniqid();
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$id = $this->getUniqueID();
|
||||
$this->config = include('files_external/tests/config.php');
|
||||
if ( ! is_array($this->config) or ! isset($this->config['owncloud']) or ! $this->config['owncloud']['run']) {
|
||||
$this->markTestSkipped('ownCloud backend not configured');
|
||||
|
@ -23,9 +25,11 @@ class OwnCloud extends Storage {
|
|||
$this->instance->mkdir('/');
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
if ($this->instance) {
|
||||
$this->instance->rmdir('/');
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace Test\Files\Storage;
|
||||
|
||||
class OwnCloudFunctions extends \PHPUnit_Framework_TestCase {
|
||||
class OwnCloudFunctions extends \Test\TestCase {
|
||||
|
||||
function configUrlProvider() {
|
||||
return array(
|
||||
|
|
|
@ -25,8 +25,10 @@ namespace Test\Files\Storage;
|
|||
class SFTP extends Storage {
|
||||
private $config;
|
||||
|
||||
public function setUp() {
|
||||
$id = uniqid();
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$id = $this->getUniqueID();
|
||||
$this->config = include('files_external/tests/config.php');
|
||||
if ( ! is_array($this->config) or ! isset($this->config['sftp']) or ! $this->config['sftp']['run']) {
|
||||
$this->markTestSkipped('SFTP backend not configured');
|
||||
|
@ -36,9 +38,11 @@ class SFTP extends Storage {
|
|||
$this->instance->mkdir('/');
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
if ($this->instance) {
|
||||
$this->instance->rmdir('/');
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,8 +12,10 @@ class SMB extends Storage {
|
|||
|
||||
private $config;
|
||||
|
||||
public function setUp() {
|
||||
$id = uniqid();
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$id = $this->getUniqueID();
|
||||
$this->config = include('files_external/tests/config.php');
|
||||
if (!is_array($this->config) or !isset($this->config['smb']) or !$this->config['smb']['run']) {
|
||||
$this->markTestSkipped('Samba backend not configured');
|
||||
|
@ -23,10 +25,12 @@ class SMB extends Storage {
|
|||
$this->instance->mkdir('/');
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
if ($this->instance) {
|
||||
\OCP\Files::rmdirr($this->instance->constructUrl(''));
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function directoryProvider() {
|
||||
|
|
|
@ -8,10 +8,11 @@
|
|||
|
||||
namespace Test\Files\Storage;
|
||||
|
||||
class SMBFunctions extends \PHPUnit_Framework_TestCase {
|
||||
class SMBFunctions extends \Test\TestCase {
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
public function setUp() {
|
||||
$id = uniqid();
|
||||
// dummy config
|
||||
$this->config = array(
|
||||
'run'=>false,
|
||||
|
@ -25,9 +26,6 @@ class SMBFunctions extends \PHPUnit_Framework_TestCase {
|
|||
$this->instance = new \OC\Files\Storage\SMB($this->config);
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
}
|
||||
|
||||
public function testGetId() {
|
||||
$this->assertEquals('smb::test@smbhost//sharename//rootdir/', $this->instance->getId());
|
||||
}
|
||||
|
|
|
@ -26,7 +26,9 @@ class Swift extends Storage {
|
|||
|
||||
private $config;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->config = include('files_external/tests/config.php');
|
||||
if (!is_array($this->config) or !isset($this->config['swift'])
|
||||
or !$this->config['swift']['run']) {
|
||||
|
@ -35,7 +37,7 @@ class Swift extends Storage {
|
|||
$this->instance = new \OC\Files\Storage\Swift($this->config['swift']);
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
if ($this->instance) {
|
||||
$connection = $this->instance->getConnection();
|
||||
$container = $connection->getContainer($this->config['swift']['bucket']);
|
||||
|
@ -48,5 +50,7 @@ class Swift extends Storage {
|
|||
|
||||
$container->delete();
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,8 +12,10 @@ class DAV extends Storage {
|
|||
|
||||
private $config;
|
||||
|
||||
public function setUp() {
|
||||
$id = uniqid();
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$id = $this->getUniqueID();
|
||||
$this->config = include('files_external/tests/config.php');
|
||||
if ( ! is_array($this->config) or ! isset($this->config['webdav']) or ! $this->config['webdav']['run']) {
|
||||
$this->markTestSkipped('WebDAV backend not configured');
|
||||
|
@ -26,9 +28,11 @@ class DAV extends Storage {
|
|||
$this->instance->mkdir('/');
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
if ($this->instance) {
|
||||
$this->instance->rmdir('/');
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ class Test_Files_Sharing_Api extends TestCase {
|
|||
|
||||
private static $tempStorage;
|
||||
|
||||
function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
\OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups', 'no');
|
||||
|
@ -53,7 +53,7 @@ class Test_Files_Sharing_Api extends TestCase {
|
|||
$this->view->file_put_contents($this->folder . $this->subfolder . $this->filename, $this->data);
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
protected function tearDown() {
|
||||
if($this->view instanceof \OC\Files\View) {
|
||||
$this->view->unlink($this->filename);
|
||||
$this->view->deleteAll($this->folder);
|
||||
|
|
|
@ -34,7 +34,7 @@ class Test_Files_Sharing_Backend extends TestCase {
|
|||
public $subfolder;
|
||||
public $subsubfolder;
|
||||
|
||||
function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->folder = self::TEST_FOLDER_NAME;
|
||||
|
@ -53,7 +53,7 @@ class Test_Files_Sharing_Backend extends TestCase {
|
|||
$this->view->file_put_contents($this->folder . $this->subfolder . $this->subsubfolder . $this->filename, $this->data);
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
protected function tearDown() {
|
||||
$this->view->unlink($this->filename);
|
||||
$this->view->deleteAll($this->folder);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ class Test_Files_Sharing_Cache extends TestCase {
|
|||
/** @var \OC\Files\Storage\Storage */
|
||||
protected $sharedStorage;
|
||||
|
||||
function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
\OC_User::setDisplayName(self::TEST_FILES_SHARING_API_USER1, 'User One');
|
||||
|
@ -88,7 +88,7 @@ class Test_Files_Sharing_Cache extends TestCase {
|
|||
$this->sharedCache = $this->sharedStorage->getCache();
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
protected function tearDown() {
|
||||
$this->sharedCache->clear();
|
||||
|
||||
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
/**
|
||||
* Tests for the external Storage class for remote shares.
|
||||
*/
|
||||
class Test_Files_Sharing_External_Storage extends \PHPUnit_Framework_TestCase {
|
||||
class Test_Files_Sharing_External_Storage extends \Test\TestCase {
|
||||
|
||||
function optionsProvider() {
|
||||
return array(
|
||||
|
|
|
@ -61,7 +61,7 @@ class Test_Files_Sharing_Permissions extends OCA\Files_sharing\Tests\TestCase {
|
|||
*/
|
||||
private $ownerCache;
|
||||
|
||||
function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
|
||||
|
@ -99,7 +99,7 @@ class Test_Files_Sharing_Permissions extends OCA\Files_sharing\Tests\TestCase {
|
|||
$this->sharedCacheRestrictedShare = $this->sharedStorageRestrictedShare->getCache();
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
protected function tearDown() {
|
||||
$this->sharedCache->clear();
|
||||
|
||||
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
|
||||
|
|
|
@ -32,7 +32,7 @@ class Test_Files_Sharing_Proxy extends OCA\Files_sharing\Tests\TestCase {
|
|||
|
||||
private static $tempStorage;
|
||||
|
||||
function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
// load proxies
|
||||
|
@ -53,7 +53,7 @@ class Test_Files_Sharing_Proxy extends OCA\Files_sharing\Tests\TestCase {
|
|||
$this->view->file_put_contents($this->folder . $this->subfolder . $this->filename, $this->data);
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
protected function tearDown() {
|
||||
$this->view->deleteAll($this->folder);
|
||||
|
||||
self::$tempStorage = null;
|
||||
|
|
|
@ -31,7 +31,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase {
|
|||
|
||||
private static $tempStorage;
|
||||
|
||||
function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->folder = self::TEST_FOLDER_NAME;
|
||||
|
@ -49,7 +49,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase {
|
|||
$this->view->file_put_contents($this->folder . $this->subfolder . $this->filename, $this->data);
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
protected function tearDown() {
|
||||
$this->view->unlink($this->filename);
|
||||
$this->view->deleteAll($this->folder);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
*/
|
||||
class Test_Files_Sharing_Mount extends OCA\Files_sharing\Tests\TestCase {
|
||||
|
||||
function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->folder = '/folder_share_storage_test';
|
||||
|
@ -40,7 +40,7 @@ class Test_Files_Sharing_Mount extends OCA\Files_sharing\Tests\TestCase {
|
|||
$this->view->file_put_contents($this->folder . $this->filename, "file in subfolder");
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
protected function tearDown() {
|
||||
$this->view->unlink($this->folder);
|
||||
$this->view->unlink($this->filename);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ use OCA\Files\Share;
|
|||
*/
|
||||
class Test_Files_Sharing_Storage extends OCA\Files_sharing\Tests\TestCase {
|
||||
|
||||
function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->folder = '/folder_share_storage_test';
|
||||
|
@ -42,7 +42,7 @@ class Test_Files_Sharing_Storage extends OCA\Files_sharing\Tests\TestCase {
|
|||
$this->view->file_put_contents($this->folder . $this->filename, "file in subfolder");
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
protected function tearDown() {
|
||||
$this->view->unlink($this->folder);
|
||||
$this->view->unlink($this->filename);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ use OCA\Files\Share;
|
|||
*
|
||||
* Base class for sharing tests.
|
||||
*/
|
||||
abstract class TestCase extends \PHPUnit_Framework_TestCase {
|
||||
abstract class TestCase extends \Test\TestCase {
|
||||
|
||||
const TEST_FILES_SHARING_API_USER1 = "test-share-user1";
|
||||
const TEST_FILES_SHARING_API_USER2 = "test-share-user2";
|
||||
|
@ -49,6 +49,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
|
|||
public $subfolder;
|
||||
|
||||
public static function setUpBeforeClass() {
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
// remember files_encryption state
|
||||
self::$stateFilesEncryption = \OC_App::isEnabled('files_encryption');
|
||||
|
@ -84,7 +85,8 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
|
|||
|
||||
}
|
||||
|
||||
function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->assertFalse(\OC_App::isEnabled('files_encryption'));
|
||||
|
||||
|
@ -95,13 +97,14 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
|
|||
$this->view = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER1 . '/files');
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
protected function tearDown() {
|
||||
$query = \OCP\DB::prepare('DELETE FROM `*PREFIX*share`');
|
||||
$query->execute();
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass() {
|
||||
|
||||
// cleanup users
|
||||
\OC_User::deleteUser(self::TEST_FILES_SHARING_API_USER1);
|
||||
\OC_User::deleteUser(self::TEST_FILES_SHARING_API_USER2);
|
||||
|
@ -120,6 +123,8 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
|
|||
\OC_Util::tearDownFS();
|
||||
\OC_User::setUserId('');
|
||||
Filesystem::tearDown();
|
||||
|
||||
parent::tearDownAfterClass();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -33,7 +33,7 @@ class Test_Files_Sharing_Updater extends OCA\Files_sharing\Tests\TestCase {
|
|||
\OCA\Files_Sharing\Helper::registerHooks();
|
||||
}
|
||||
|
||||
function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->folder = self::TEST_FOLDER_NAME;
|
||||
|
@ -46,7 +46,7 @@ class Test_Files_Sharing_Updater extends OCA\Files_sharing\Tests\TestCase {
|
|||
$this->view->file_put_contents($this->folder . '/' . $this->filename, $this->data);
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
protected function tearDown() {
|
||||
$this->view->unlink($this->filename);
|
||||
$this->view->deleteAll($this->folder);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ class Test_Files_Sharing_Watcher extends OCA\Files_sharing\Tests\TestCase {
|
|||
*/
|
||||
private $sharedCache;
|
||||
|
||||
function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
|
||||
|
@ -71,7 +71,7 @@ class Test_Files_Sharing_Watcher extends OCA\Files_sharing\Tests\TestCase {
|
|||
$this->sharedCache = $this->sharedStorage->getCache();
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
protected function tearDown() {
|
||||
$this->sharedCache->clear();
|
||||
|
||||
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
|
||||
|
|
|
@ -25,7 +25,7 @@ use OCA\Files_Trashbin;
|
|||
/**
|
||||
* Class Test_Encryption_Crypt
|
||||
*/
|
||||
class Test_Trashbin extends \PHPUnit_Framework_TestCase {
|
||||
class Test_Trashbin extends \Test\TestCase {
|
||||
|
||||
const TEST_TRASHBIN_USER1 = "test-trashbin-user1";
|
||||
const TEST_TRASHBIN_USER2 = "test-trashbin-user2";
|
||||
|
@ -43,6 +43,8 @@ class Test_Trashbin extends \PHPUnit_Framework_TestCase {
|
|||
private $rootView;
|
||||
|
||||
public static function setUpBeforeClass() {
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
// reset backend
|
||||
\OC_User::clearBackends();
|
||||
\OC_User::useBackend('database');
|
||||
|
@ -85,18 +87,24 @@ class Test_Trashbin extends \PHPUnit_Framework_TestCase {
|
|||
\OC_Config::setValue('trashbin_auto_expire', self::$rememberAutoExpire);
|
||||
|
||||
\OC_Hook::clear();
|
||||
|
||||
parent::tearDownAfterClass();
|
||||
}
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->trashRoot1 = '/' . self::TEST_TRASHBIN_USER1 . '/files_trashbin';
|
||||
$this->trashRoot2 = '/' . self::TEST_TRASHBIN_USER2 . '/files_trashbin';
|
||||
$this->rootView = new \OC\Files\View();
|
||||
self::loginHelper(self::TEST_TRASHBIN_USER1);
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
$this->rootView->deleteAll($this->trashRoot1);
|
||||
$this->rootView->deleteAll($this->trashRoot2);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,7 +27,7 @@ require_once __DIR__ . '/../lib/versions.php';
|
|||
* Class Test_Files_versions
|
||||
* this class provide basic files versions test
|
||||
*/
|
||||
class Test_Files_Versioning extends \PHPUnit_Framework_TestCase {
|
||||
class Test_Files_Versioning extends \Test\TestCase {
|
||||
|
||||
const TEST_VERSIONS_USER = 'test-versions-user';
|
||||
const TEST_VERSIONS_USER2 = 'test-versions-user2';
|
||||
|
@ -39,6 +39,7 @@ class Test_Files_Versioning extends \PHPUnit_Framework_TestCase {
|
|||
private $rootView;
|
||||
|
||||
public static function setUpBeforeClass() {
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
// clear share hooks
|
||||
\OC_Hook::clear('OCP\\Share');
|
||||
|
@ -55,9 +56,13 @@ class Test_Files_Versioning extends \PHPUnit_Framework_TestCase {
|
|||
// cleanup test user
|
||||
\OC_User::deleteUser(self::TEST_VERSIONS_USER);
|
||||
\OC_User::deleteUser(self::TEST_VERSIONS_USER2);
|
||||
|
||||
parent::tearDownAfterClass();
|
||||
}
|
||||
|
||||
function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
self::loginHelper(self::TEST_VERSIONS_USER);
|
||||
$this->rootView = new \OC\Files\View();
|
||||
if (!$this->rootView->file_exists(self::USERS_VERSIONS_ROOT)) {
|
||||
|
@ -65,8 +70,10 @@ class Test_Files_Versioning extends \PHPUnit_Framework_TestCase {
|
|||
}
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
protected function tearDown() {
|
||||
$this->rootView->deleteAll(self::USERS_VERSIONS_ROOT);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -74,7 +81,7 @@ class Test_Files_Versioning extends \PHPUnit_Framework_TestCase {
|
|||
* test expire logic
|
||||
* @dataProvider versionsProvider
|
||||
*/
|
||||
function testGetExpireList($versions, $sizeOfAllDeletedFiles) {
|
||||
public function testGetExpireList($versions, $sizeOfAllDeletedFiles) {
|
||||
|
||||
// last interval end at 2592000
|
||||
$startTime = 5000000;
|
||||
|
@ -216,7 +223,7 @@ class Test_Files_Versioning extends \PHPUnit_Framework_TestCase {
|
|||
);
|
||||
}
|
||||
|
||||
function testRename() {
|
||||
public function testRename() {
|
||||
|
||||
\OC\Files\Filesystem::file_put_contents("test.txt", "test file");
|
||||
|
||||
|
@ -247,7 +254,7 @@ class Test_Files_Versioning extends \PHPUnit_Framework_TestCase {
|
|||
\OC\Files\Filesystem::unlink('test2.txt');
|
||||
}
|
||||
|
||||
function testRenameInSharedFolder() {
|
||||
public function testRenameInSharedFolder() {
|
||||
|
||||
\OC\Files\Filesystem::mkdir('folder1');
|
||||
\OC\Files\Filesystem::mkdir('folder1/folder2');
|
||||
|
@ -291,7 +298,7 @@ class Test_Files_Versioning extends \PHPUnit_Framework_TestCase {
|
|||
\OC\Files\Filesystem::unlink('/folder1/folder2/test.txt');
|
||||
}
|
||||
|
||||
function testRenameSharedFile() {
|
||||
public function testRenameSharedFile() {
|
||||
|
||||
\OC\Files\Filesystem::file_put_contents("test.txt", "test file");
|
||||
|
||||
|
@ -334,7 +341,7 @@ class Test_Files_Versioning extends \PHPUnit_Framework_TestCase {
|
|||
\OC\Files\Filesystem::unlink('/test.txt');
|
||||
}
|
||||
|
||||
function testCopy() {
|
||||
public function testCopy() {
|
||||
|
||||
\OC\Files\Filesystem::file_put_contents("test.txt", "test file");
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ use \OCA\user_ldap\lib\Access;
|
|||
use \OCA\user_ldap\lib\Connection;
|
||||
use \OCA\user_ldap\lib\ILDAPWrapper;
|
||||
|
||||
class Test_Access extends \PHPUnit_Framework_TestCase {
|
||||
class Test_Access extends \Test\TestCase {
|
||||
private function getConnecterAndLdapMock() {
|
||||
static $conMethods;
|
||||
static $accMethods;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
namespace OCA\user_ldap\tests;
|
||||
|
||||
class Test_Connection extends \PHPUnit_Framework_TestCase {
|
||||
class Test_Connection extends \Test\TestCase {
|
||||
|
||||
public function testOriginalAgentUnchangedOnClone() {
|
||||
//background: upon login a bind is done with the user credentials
|
||||
|
|
|
@ -22,14 +22,12 @@
|
|||
|
||||
namespace OCA\user_ldap\tests;
|
||||
|
||||
namespace OCA\user_ldap\tests;
|
||||
|
||||
use \OCA\user_ldap\GROUP_LDAP as GroupLDAP;
|
||||
use \OCA\user_ldap\lib\Access;
|
||||
use \OCA\user_ldap\lib\Connection;
|
||||
use \OCA\user_ldap\lib\ILDAPWrapper;
|
||||
|
||||
class Test_Group_Ldap extends \PHPUnit_Framework_TestCase {
|
||||
class Test_Group_Ldap extends \Test\TestCase {
|
||||
private function getAccessMock() {
|
||||
static $conMethods;
|
||||
static $accMethods;
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace OCA\user_ldap\tests;
|
|||
|
||||
use OCA\user_ldap\lib\Helper;
|
||||
|
||||
class Test_Helper extends \PHPUnit_Framework_TestCase {
|
||||
class Test_Helper extends \Test\TestCase {
|
||||
|
||||
public function testTableTruncate() {
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace OCA\user_ldap\tests;
|
|||
|
||||
use OCA\user_ldap\lib\user\Manager;
|
||||
|
||||
class Test_User_Manager extends \PHPUnit_Framework_TestCase {
|
||||
class Test_User_Manager extends \Test\TestCase {
|
||||
|
||||
private function getTestInstances() {
|
||||
$access = $this->getMock('\OCA\user_ldap\lib\user\IUserTools');
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace OCA\user_ldap\tests;
|
|||
|
||||
use OCA\user_ldap\lib\user\User;
|
||||
|
||||
class Test_User_User extends \PHPUnit_Framework_TestCase {
|
||||
class Test_User_User extends \Test\TestCase {
|
||||
|
||||
private function getTestInstances() {
|
||||
$access = $this->getMock('\OCA\user_ldap\lib\user\IUserTools');
|
||||
|
|
|
@ -27,11 +27,13 @@ use \OCA\user_ldap\lib\Access;
|
|||
use \OCA\user_ldap\lib\Connection;
|
||||
use \OCA\user_ldap\lib\ILDAPWrapper;
|
||||
|
||||
class Test_User_Ldap_Direct extends \PHPUnit_Framework_TestCase {
|
||||
class Test_User_Ldap_Direct extends \Test\TestCase {
|
||||
protected $backend;
|
||||
protected $access;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
\OC_User::clearBackends();
|
||||
\OC_Group::clearBackends();
|
||||
}
|
||||
|
|
|
@ -29,8 +29,9 @@ use \OCA\user_ldap\lib\Wizard;
|
|||
// use \OCA\user_ldap\lib\Configuration;
|
||||
// use \OCA\user_ldap\lib\ILDAPWrapper;
|
||||
|
||||
class Test_Wizard extends \PHPUnit_Framework_TestCase {
|
||||
public function setUp() {
|
||||
class Test_Wizard extends \Test\TestCase {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
//we need to make sure the consts are defined, otherwise tests will fail
|
||||
//on systems without php5_ldap
|
||||
$ldapConsts = array('LDAP_OPT_PROTOCOL_VERSION',
|
||||
|
|
|
@ -24,9 +24,6 @@ class MappedLocal extends \OC\Files\Storage\Common {
|
|||
}
|
||||
|
||||
public function __destruct() {
|
||||
if (defined('PHPUNIT_RUN')) {
|
||||
$this->mapper->removePath($this->datadir, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
public function getId() {
|
||||
|
|
|
@ -8,12 +8,14 @@
|
|||
*
|
||||
*/
|
||||
|
||||
class Test_ActivityManager extends PHPUnit_Framework_TestCase {
|
||||
class Test_ActivityManager extends \Test\TestCase {
|
||||
|
||||
/** @var \OC\ActivityManager */
|
||||
private $activityManager;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->activityManager = new \OC\ActivityManager();
|
||||
$this->activityManager->registerExtension(function() {
|
||||
return new NoOpExtension();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
class Test_API extends PHPUnit_Framework_TestCase {
|
||||
class Test_API extends \Test\TestCase {
|
||||
|
||||
// Helps build a response variable
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
class Test_App extends PHPUnit_Framework_TestCase {
|
||||
class Test_App extends \Test\TestCase {
|
||||
|
||||
private $oldAppConfigService;
|
||||
|
||||
|
|
|
@ -7,8 +7,10 @@
|
|||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
class Test_Appconfig extends PHPUnit_Framework_TestCase {
|
||||
class Test_Appconfig extends \Test\TestCase {
|
||||
public static function setUpBeforeClass() {
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
$query = \OC_DB::prepare('INSERT INTO `*PREFIX*appconfig` VALUES (?, ?, ?)');
|
||||
|
||||
$query->execute(array('testapp', 'enabled', 'true'));
|
||||
|
@ -33,6 +35,8 @@ class Test_Appconfig extends PHPUnit_Framework_TestCase {
|
|||
$query->execute(array('someapp'));
|
||||
$query->execute(array('123456'));
|
||||
$query->execute(array('anotherapp'));
|
||||
|
||||
parent::tearDownAfterClass();
|
||||
}
|
||||
|
||||
public function testGetApps() {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
namespace OC\AppFramework;
|
||||
|
||||
|
||||
class AppTest extends \PHPUnit_Framework_TestCase {
|
||||
class AppTest extends \Test\TestCase {
|
||||
|
||||
private $container;
|
||||
private $api;
|
||||
|
@ -38,6 +38,8 @@ class AppTest extends \PHPUnit_Framework_TestCase {
|
|||
private $controllerMethod;
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->container = new \OC\AppFramework\DependencyInjection\DIContainer('test', array());
|
||||
$this->controller = $this->getMockBuilder(
|
||||
'OCP\AppFramework\Controller')
|
||||
|
|
|
@ -31,7 +31,7 @@ use OCP\AppFramework\Http\TemplateResponse;
|
|||
class ChildApiController extends ApiController {};
|
||||
|
||||
|
||||
class ApiControllerTest extends \PHPUnit_Framework_TestCase {
|
||||
class ApiControllerTest extends \Test\TestCase {
|
||||
|
||||
|
||||
public function testCors() {
|
||||
|
|
|
@ -54,7 +54,7 @@ class ChildController extends Controller {
|
|||
}
|
||||
};
|
||||
|
||||
class ControllerTest extends \PHPUnit_Framework_TestCase {
|
||||
class ControllerTest extends \Test\TestCase {
|
||||
|
||||
/**
|
||||
* @var Controller
|
||||
|
@ -63,6 +63,8 @@ class ControllerTest extends \PHPUnit_Framework_TestCase {
|
|||
private $app;
|
||||
|
||||
protected function setUp(){
|
||||
parent::setUp();
|
||||
|
||||
$request = new Request(
|
||||
array(
|
||||
'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'),
|
||||
|
|
|
@ -49,11 +49,12 @@ class TestEntity extends Entity {
|
|||
};
|
||||
|
||||
|
||||
class EntityTest extends \PHPUnit_Framework_TestCase {
|
||||
class EntityTest extends \Test\TestCase {
|
||||
|
||||
private $entity;
|
||||
|
||||
protected function setUp(){
|
||||
parent::setUp();
|
||||
$this->entity = new TestEntity();
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class MapperTest extends MapperTestUtility {
|
|||
*/
|
||||
private $mapper;
|
||||
|
||||
public function setUp(){
|
||||
protected function setUp(){
|
||||
parent::setUp();
|
||||
$this->mapper = new ExampleMapper($this->db);
|
||||
}
|
||||
|
|
|
@ -28,9 +28,7 @@ namespace Test\AppFramework\Db;
|
|||
/**
|
||||
* Simple utility class for testing mappers
|
||||
*/
|
||||
abstract class MapperTestUtility extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
|
||||
abstract class MapperTestUtility extends \Test\TestCase {
|
||||
protected $db;
|
||||
private $query;
|
||||
private $pdoResult;
|
||||
|
@ -45,6 +43,8 @@ abstract class MapperTestUtility extends \PHPUnit_Framework_TestCase {
|
|||
* db. After this the db can be accessed by using $this->db
|
||||
*/
|
||||
protected function setUp(){
|
||||
parent::setUp();
|
||||
|
||||
$this->db = $this->getMockBuilder(
|
||||
'\OCP\IDb')
|
||||
->disableOriginalConstructor()
|
||||
|
|
|
@ -29,12 +29,13 @@ namespace OC\AppFramework\DependencyInjection;
|
|||
use \OC\AppFramework\Http\Request;
|
||||
|
||||
|
||||
class DIContainerTest extends \PHPUnit_Framework_TestCase {
|
||||
class DIContainerTest extends \Test\TestCase {
|
||||
|
||||
private $container;
|
||||
private $api;
|
||||
|
||||
protected function setUp(){
|
||||
parent::setUp();
|
||||
$this->container = new DIContainer('name');
|
||||
$this->api = $this->getMock('OC\AppFramework\Core\API', array(), array('hi'));
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ use OCP\AppFramework\Http\DataResponse;
|
|||
use OCP\AppFramework\Http;
|
||||
|
||||
|
||||
class DataResponseTest extends \PHPUnit_Framework_TestCase {
|
||||
class DataResponseTest extends \Test\TestCase {
|
||||
|
||||
/**
|
||||
* @var DataResponse
|
||||
|
@ -37,6 +37,7 @@ class DataResponseTest extends \PHPUnit_Framework_TestCase {
|
|||
private $response;
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->response = new DataResponse();
|
||||
}
|
||||
|
||||
|
|
|
@ -62,9 +62,7 @@ class TestController extends Controller {
|
|||
}
|
||||
|
||||
|
||||
class DispatcherTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
|
||||
class DispatcherTest extends \Test\TestCase {
|
||||
private $middlewareDispatcher;
|
||||
private $dispatcher;
|
||||
private $controllerMethod;
|
||||
|
@ -75,6 +73,7 @@ class DispatcherTest extends \PHPUnit_Framework_TestCase {
|
|||
private $reflector;
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->controllerMethod = 'test';
|
||||
|
||||
$app = $this->getMockBuilder(
|
||||
|
|
|
@ -30,7 +30,7 @@ class ChildDownloadResponse extends DownloadResponse {
|
|||
};
|
||||
|
||||
|
||||
class DownloadResponseTest extends \PHPUnit_Framework_TestCase {
|
||||
class DownloadResponseTest extends \Test\TestCase {
|
||||
|
||||
/**
|
||||
* @var ChildDownloadResponse
|
||||
|
@ -38,6 +38,7 @@ class DownloadResponseTest extends \PHPUnit_Framework_TestCase {
|
|||
protected $response;
|
||||
|
||||
protected function setUp(){
|
||||
parent::setUp();
|
||||
$this->response = new ChildDownloadResponse('file', 'content');
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace OC\AppFramework\Http;
|
|||
use OC\AppFramework\Http;
|
||||
|
||||
|
||||
class HttpTest extends \PHPUnit_Framework_TestCase {
|
||||
class HttpTest extends \Test\TestCase {
|
||||
|
||||
private $server;
|
||||
|
||||
|
@ -37,6 +37,8 @@ class HttpTest extends \PHPUnit_Framework_TestCase {
|
|||
private $http;
|
||||
|
||||
protected function setUp(){
|
||||
parent::setUp();
|
||||
|
||||
$this->server = array();
|
||||
$this->http = new Http($this->server);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace OC\AppFramework\Http;
|
|||
use OCP\AppFramework\Http\JSONResponse;
|
||||
use OCP\AppFramework\Http;
|
||||
|
||||
class JSONResponseTest extends \PHPUnit_Framework_TestCase {
|
||||
class JSONResponseTest extends \Test\TestCase {
|
||||
|
||||
/**
|
||||
* @var JSONResponse
|
||||
|
@ -38,6 +38,7 @@ class JSONResponseTest extends \PHPUnit_Framework_TestCase {
|
|||
private $json;
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->json = new JSONResponse();
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace OCP\AppFramework\Http;
|
|||
use OCP\AppFramework\Http;
|
||||
|
||||
|
||||
class RedirectResponseTest extends \PHPUnit_Framework_TestCase {
|
||||
class RedirectResponseTest extends \Test\TestCase {
|
||||
|
||||
/**
|
||||
* @var RedirectResponse
|
||||
|
@ -35,6 +35,7 @@ class RedirectResponseTest extends \PHPUnit_Framework_TestCase {
|
|||
protected $response;
|
||||
|
||||
protected function setUp(){
|
||||
parent::setUp();
|
||||
$this->response = new RedirectResponse('/url');
|
||||
}
|
||||
|
||||
|
|
|
@ -10,9 +10,11 @@ namespace OC\AppFramework\Http;
|
|||
|
||||
global $data;
|
||||
|
||||
class RequestTest extends \PHPUnit_Framework_TestCase {
|
||||
class RequestTest extends \Test\TestCase {
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
public function setUp() {
|
||||
require_once __DIR__ . '/requeststream.php';
|
||||
if (in_array('fakeinput', stream_get_wrappers())) {
|
||||
stream_wrapper_unregister('fakeinput');
|
||||
|
@ -21,8 +23,9 @@ class RequestTest extends \PHPUnit_Framework_TestCase {
|
|||
$this->stream = 'fakeinput://data';
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
stream_wrapper_unregister('fakeinput');
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testRequestAccessors() {
|
||||
|
|
|
@ -29,7 +29,7 @@ use OCP\AppFramework\Http\Response;
|
|||
use OCP\AppFramework\Http;
|
||||
|
||||
|
||||
class ResponseTest extends \PHPUnit_Framework_TestCase {
|
||||
class ResponseTest extends \Test\TestCase {
|
||||
|
||||
/**
|
||||
* @var \OCP\AppFramework\Http\Response
|
||||
|
@ -37,6 +37,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase {
|
|||
private $childResponse;
|
||||
|
||||
protected function setUp(){
|
||||
parent::setUp();
|
||||
$this->childResponse = new Response();
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ use OCP\AppFramework\Http\TemplateResponse;
|
|||
use OCP\AppFramework\Http;
|
||||
|
||||
|
||||
class TemplateResponseTest extends \PHPUnit_Framework_TestCase {
|
||||
class TemplateResponseTest extends \Test\TestCase {
|
||||
|
||||
/**
|
||||
* @var \OCP\AppFramework\Http\TemplateResponse
|
||||
|
@ -41,6 +41,8 @@ class TemplateResponseTest extends \PHPUnit_Framework_TestCase {
|
|||
private $api;
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->api = $this->getMock('OC\AppFramework\Core\API',
|
||||
array('getAppName'), array('test'));
|
||||
$this->api->expects($this->any())
|
||||
|
|
|
@ -100,7 +100,7 @@ class TestMiddleware extends Middleware {
|
|||
}
|
||||
|
||||
|
||||
class MiddlewareDispatcherTest extends \PHPUnit_Framework_TestCase {
|
||||
class MiddlewareDispatcherTest extends \Test\TestCase {
|
||||
|
||||
public $exception;
|
||||
public $response;
|
||||
|
@ -113,8 +113,9 @@ class MiddlewareDispatcherTest extends \PHPUnit_Framework_TestCase {
|
|||
*/
|
||||
private $dispatcher;
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
public function setUp() {
|
||||
$this->dispatcher = new MiddlewareDispatcher();
|
||||
$this->controller = $this->getControllerMock();
|
||||
$this->method = 'method';
|
||||
|
|
|
@ -31,7 +31,7 @@ use OCP\AppFramework\Middleware;
|
|||
class ChildMiddleware extends Middleware {};
|
||||
|
||||
|
||||
class MiddlewareTest extends \PHPUnit_Framework_TestCase {
|
||||
class MiddlewareTest extends \Test\TestCase {
|
||||
|
||||
/**
|
||||
* @var Middleware
|
||||
|
@ -42,6 +42,8 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase {
|
|||
private $api;
|
||||
|
||||
protected function setUp(){
|
||||
parent::setUp();
|
||||
|
||||
$this->middleware = new ChildMiddleware();
|
||||
|
||||
$this->api = $this->getMockBuilder(
|
||||
|
|
|
@ -18,11 +18,12 @@ use OC\AppFramework\Utility\ControllerMethodReflector;
|
|||
use OCP\AppFramework\Http\Response;
|
||||
|
||||
|
||||
class CORSMiddlewareTest extends \PHPUnit_Framework_TestCase {
|
||||
class CORSMiddlewareTest extends \Test\TestCase {
|
||||
|
||||
private $reflector;
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->reflector = new ControllerMethodReflector();
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ use OCP\AppFramework\Http\RedirectResponse;
|
|||
use OCP\AppFramework\Http\JSONResponse;
|
||||
|
||||
|
||||
class SecurityMiddlewareTest extends \PHPUnit_Framework_TestCase {
|
||||
class SecurityMiddlewareTest extends \Test\TestCase {
|
||||
|
||||
private $middleware;
|
||||
private $controller;
|
||||
|
@ -43,7 +43,9 @@ class SecurityMiddlewareTest extends \PHPUnit_Framework_TestCase {
|
|||
private $navigationManager;
|
||||
private $urlGenerator;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->controller = $this->getMockBuilder('OCP\AppFramework\Controller')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
|
|
@ -18,7 +18,7 @@ use OC\AppFramework\Utility\ControllerMethodReflector;
|
|||
use OCP\AppFramework\Http\Response;
|
||||
|
||||
|
||||
class SessionMiddlewareTest extends \PHPUnit_Framework_TestCase {
|
||||
class SessionMiddlewareTest extends \Test\TestCase {
|
||||
|
||||
/**
|
||||
* @var ControllerMethodReflector
|
||||
|
@ -31,6 +31,8 @@ class SessionMiddlewareTest extends \PHPUnit_Framework_TestCase {
|
|||
private $request;
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->request = new Request();
|
||||
$this->reflector = new ControllerMethodReflector();
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ use OC\AppFramework\DependencyInjection\DIContainer;
|
|||
use OC\AppFramework\routing\RouteConfig;
|
||||
|
||||
|
||||
class RoutingTest extends \PHPUnit_Framework_TestCase
|
||||
class RoutingTest extends \Test\TestCase
|
||||
{
|
||||
|
||||
public function testSimpleRoute()
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
namespace OC\AppFramework\Utility;
|
||||
|
||||
|
||||
class ControllerMethodReflectorTest extends \PHPUnit_Framework_TestCase {
|
||||
class ControllerMethodReflectorTest extends \Test\TestCase {
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
abstract class Test_Archive extends PHPUnit_Framework_TestCase {
|
||||
abstract class Test_Archive extends \Test\TestCase {
|
||||
/**
|
||||
* @var OC_Archive
|
||||
*/
|
||||
|
|
|
@ -7,11 +7,12 @@
|
|||
*/
|
||||
|
||||
class Test_Archive_TAR extends Test_Archive {
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
if (OC_Util::runningOnWindows()) {
|
||||
$this->markTestSkipped('[Windows] tar archives are not supported on Windows');
|
||||
}
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
protected function getExisting() {
|
||||
|
|
|
@ -6,8 +6,15 @@
|
|||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
if (!OC_Util::runningOnWindows()) {
|
||||
class Test_Archive_ZIP extends Test_Archive {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
if (OC_Util::runningOnWindows()) {
|
||||
$this->markTestSkipped('[Windows] ');
|
||||
}
|
||||
}
|
||||
|
||||
protected function getExisting() {
|
||||
$dir = OC::$SERVERROOT . '/tests/data';
|
||||
return new OC_Archive_ZIP($dir . '/data.zip');
|
||||
|
@ -17,4 +24,3 @@ class Test_Archive_ZIP extends Test_Archive {
|
|||
return new OC_Archive_ZIP(OCP\Files::tmpFile('.zip'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,13 +8,14 @@
|
|||
|
||||
namespace Test;
|
||||
|
||||
class AutoLoader extends \PHPUnit_Framework_TestCase {
|
||||
class AutoLoader extends TestCase {
|
||||
/**
|
||||
* @var \OC\Autoloader $loader
|
||||
*/
|
||||
private $loader;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->loader = new \OC\AutoLoader();
|
||||
}
|
||||
|
||||
|
|
|
@ -6,12 +6,14 @@
|
|||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
class Test_Avatar extends PHPUnit_Framework_TestCase {
|
||||
class Test_Avatar extends \Test\TestCase {
|
||||
|
||||
private $user;
|
||||
|
||||
public function setUp() {
|
||||
$this->user = uniqid();
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->user = $this->getUniqueID();
|
||||
$storage = new \OC\Files\Storage\Temporary(array());
|
||||
\OC\Files\Filesystem::mount($storage, array(), '/' . $this->user . '/');
|
||||
}
|
||||
|
|
|
@ -8,10 +8,11 @@
|
|||
|
||||
namespace Test\BackgroundJob;
|
||||
|
||||
class Job extends \PHPUnit_Framework_TestCase {
|
||||
class Job extends \Test\TestCase {
|
||||
private $run = false;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->run = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace Test\BackgroundJob;
|
||||
|
||||
class JobList extends \PHPUnit_Framework_TestCase {
|
||||
class JobList extends \Test\TestCase {
|
||||
/**
|
||||
* @var \OC\BackgroundJob\JobList
|
||||
*/
|
||||
|
@ -19,7 +19,9 @@ class JobList extends \PHPUnit_Framework_TestCase {
|
|||
*/
|
||||
protected $config;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$conn = \OC::$server->getDatabaseConnection();
|
||||
$this->config = $this->getMock('\OCP\IConfig');
|
||||
$this->instance = new \OC\BackgroundJob\JobList($conn, $this->config);
|
||||
|
|
|
@ -23,7 +23,7 @@ class TestQueuedJob extends \OC\BackgroundJob\QueuedJob {
|
|||
}
|
||||
}
|
||||
|
||||
class QueuedJob extends \PHPUnit_Framework_TestCase {
|
||||
class QueuedJob extends \Test\TestCase {
|
||||
/**
|
||||
* @var DummyJobList $jobList
|
||||
*/
|
||||
|
@ -39,7 +39,9 @@ class QueuedJob extends \PHPUnit_Framework_TestCase {
|
|||
$this->jobRun = true;
|
||||
}
|
||||
|
||||
public function setup() {
|
||||
protected function setup() {
|
||||
parent::setUp();
|
||||
|
||||
$this->jobList = new DummyJobList();
|
||||
$this->job = new TestQueuedJob($this);
|
||||
$this->jobList->add($this->job);
|
||||
|
|
|
@ -24,7 +24,7 @@ class TestTimedJob extends \OC\BackgroundJob\TimedJob {
|
|||
}
|
||||
}
|
||||
|
||||
class TimedJob extends \PHPUnit_Framework_TestCase {
|
||||
class TimedJob extends \Test\TestCase {
|
||||
/**
|
||||
* @var DummyJobList $jobList
|
||||
*/
|
||||
|
@ -40,7 +40,9 @@ class TimedJob extends \PHPUnit_Framework_TestCase {
|
|||
$this->jobRun = true;
|
||||
}
|
||||
|
||||
public function setup() {
|
||||
protected function setup() {
|
||||
parent::setUp();
|
||||
|
||||
$this->jobList = new DummyJobList();
|
||||
$this->job = new TestTimedJob($this);
|
||||
$this->jobList->add($this->job);
|
||||
|
|
|
@ -6,16 +6,18 @@
|
|||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
abstract class Test_Cache extends PHPUnit_Framework_TestCase {
|
||||
abstract class Test_Cache extends \Test\TestCase {
|
||||
/**
|
||||
* @var \OC\Cache cache;
|
||||
*/
|
||||
protected $instance;
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
if($this->instance) {
|
||||
$this->instance->clear();
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
function testSimple() {
|
||||
|
|
|
@ -33,8 +33,10 @@ class FileCache extends \Test_Cache {
|
|||
function skip() {
|
||||
//$this->skipUnless(OC_User::isLoggedIn());
|
||||
}
|
||||
|
||||
public function setUp() {
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
//clear all proxies and hooks so we can do clean testing
|
||||
\OC_FileProxy::clearProxies();
|
||||
\OC_Hook::clear('OC_Filesystem');
|
||||
|
@ -70,7 +72,7 @@ class FileCache extends \Test_Cache {
|
|||
$this->instance=new \OC\Cache\File();
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
\OC_User::setUserId($this->user);
|
||||
\OC_Config::setValue('cachedirectory', $this->datadir);
|
||||
|
||||
|
|
|
@ -30,7 +30,9 @@ class UserCache extends \Test_Cache {
|
|||
/** @var \OC\Files\Storage\Storage */
|
||||
private $storage;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
//clear all proxies and hooks so we can do clean testing
|
||||
\OC_FileProxy::clearProxies();
|
||||
\OC_Hook::clear('OC_Filesystem');
|
||||
|
@ -66,7 +68,7 @@ class UserCache extends \Test_Cache {
|
|||
$this->instance=new \OC\Cache\UserCache();
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
\OC_User::setUserId($this->user);
|
||||
\OC_Config::setValue('cachedirectory', $this->datadir);
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
class Test_Config extends PHPUnit_Framework_TestCase {
|
||||
class Test_Config extends \Test\TestCase {
|
||||
const TESTCONTENT = '<?php $CONFIG=array("foo"=>"bar", "beers" => array("Appenzeller", "Guinness", "Kölsch"), "alcohol_free" => false);';
|
||||
|
||||
/** @var array */
|
||||
|
@ -18,15 +18,18 @@ class Test_Config extends PHPUnit_Framework_TestCase {
|
|||
/** @var string */
|
||||
private $randomTmpDir;
|
||||
|
||||
function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->randomTmpDir = \OC_Helper::tmpFolder();
|
||||
$this->configFile = $this->randomTmpDir.'testconfig.php';
|
||||
file_put_contents($this->configFile, self::TESTCONTENT);
|
||||
$this->config = new OC\Config($this->randomTmpDir, 'testconfig.php');
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
unlink($this->configFile);
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testGetKeys() {
|
||||
|
|
|
@ -6,12 +6,14 @@
|
|||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
class Test_OC_Connector_Sabre_Directory extends PHPUnit_Framework_TestCase {
|
||||
class Test_OC_Connector_Sabre_Directory extends \Test\TestCase {
|
||||
|
||||
private $view;
|
||||
private $info;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->view = $this->getMock('OC\Files\View', array(), array(), '', false);
|
||||
$this->info = $this->getMock('OC\Files\FileInfo', array(), array(), '', false);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
class Test_OC_Connector_Sabre_File extends PHPUnit_Framework_TestCase {
|
||||
class Test_OC_Connector_Sabre_File extends \Test\TestCase {
|
||||
|
||||
/**
|
||||
* @expectedException \Sabre\DAV\Exception
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Test\Connector\Sabre;
|
|||
use OC\Files\FileInfo;
|
||||
use OC\Files\View;
|
||||
|
||||
class Node extends \PHPUnit_Framework_TestCase {
|
||||
class Node extends \Test\TestCase {
|
||||
public function davPermissionsProvider() {
|
||||
return array(
|
||||
array(\OCP\PERMISSION_ALL, 'file', false, false, 'RDNVW'),
|
||||
|
|
|
@ -13,7 +13,7 @@ use OC\Files\FileInfo;
|
|||
use OC_Connector_Sabre_Directory;
|
||||
use PHPUnit_Framework_TestCase;
|
||||
|
||||
class TestDoubleFileView extends \OC\Files\View{
|
||||
class TestDoubleFileView extends \OC\Files\View {
|
||||
|
||||
public function __construct($updatables, $deletables, $canRename = true) {
|
||||
$this->updatables = $updatables;
|
||||
|
@ -42,7 +42,7 @@ class TestDoubleFileView extends \OC\Files\View{
|
|||
}
|
||||
}
|
||||
|
||||
class ObjectTree extends PHPUnit_Framework_TestCase {
|
||||
class ObjectTree extends \Test\TestCase {
|
||||
|
||||
/**
|
||||
* @dataProvider moveFailedProvider
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
class Test_OC_Connector_Sabre_QuotaPlugin extends PHPUnit_Framework_TestCase {
|
||||
class Test_OC_Connector_Sabre_QuotaPlugin extends \Test\TestCase {
|
||||
|
||||
/**
|
||||
* @var \Sabre\DAV\Server
|
||||
|
|
|
@ -11,7 +11,7 @@ use OC\Contacts\LocalAddressBook;
|
|||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class Test_LocalAddressBook extends PHPUnit_Framework_TestCase
|
||||
class Test_LocalAddressBook extends \Test\TestCase
|
||||
{
|
||||
|
||||
public function testSearchFN() {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
class Test_DB extends PHPUnit_Framework_TestCase {
|
||||
class Test_DB extends \Test\TestCase {
|
||||
protected $backupGlobals = FALSE;
|
||||
|
||||
protected static $schema_file = 'static://test_db_scheme';
|
||||
|
@ -32,7 +32,9 @@ class Test_DB extends PHPUnit_Framework_TestCase {
|
|||
*/
|
||||
private $table4;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$dbfile = OC::$SERVERROOT.'/tests/data/db_structure.xml';
|
||||
|
||||
$r = '_'.OC_Util::generateRandomBytes(4).'_';
|
||||
|
@ -48,9 +50,11 @@ class Test_DB extends PHPUnit_Framework_TestCase {
|
|||
$this->table4 = $this->test_prefix.'decimal';
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
OC_DB::removeDBStructure(self::$schema_file);
|
||||
unlink(self::$schema_file);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testQuotes() {
|
||||
|
|
|
@ -12,15 +12,17 @@ namespace Test\DB;
|
|||
use Doctrine\DBAL\Platforms\OraclePlatform;
|
||||
use Doctrine\DBAL\Platforms\SQLServerPlatform;
|
||||
|
||||
class MDB2SchemaManager extends \PHPUnit_Framework_TestCase {
|
||||
class MDB2SchemaManager extends \Test\TestCase {
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
// do not drop the table for Oracle as it will create a bogus transaction
|
||||
// that will break the following test suites requiring transactions
|
||||
if (\OC::$server->getConfig()->getSystemValue('dbtype', 'sqlite') === 'oci') {
|
||||
return;
|
||||
}
|
||||
\OC_DB::dropTable('table');
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testAutoIncrement() {
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Test\DB;
|
|||
|
||||
use Doctrine\DBAL\Platforms\MySqlPlatform;
|
||||
|
||||
class MDB2SchemaReader extends \PHPUnit_Framework_TestCase {
|
||||
class MDB2SchemaReader extends \Test\TestCase {
|
||||
/**
|
||||
* @var \OC\DB\MDB2SchemaReader $reader
|
||||
*/
|
||||
|
|
|
@ -15,7 +15,7 @@ use Doctrine\DBAL\Platforms\SQLServerPlatform;
|
|||
use \Doctrine\DBAL\Schema\Schema;
|
||||
use \Doctrine\DBAL\Schema\SchemaConfig;
|
||||
|
||||
class Migrator extends \PHPUnit_Framework_TestCase {
|
||||
class Migrator extends \Test\TestCase {
|
||||
/**
|
||||
* @var \Doctrine\DBAL\Connection $connection
|
||||
*/
|
||||
|
@ -28,7 +28,9 @@ class Migrator extends \PHPUnit_Framework_TestCase {
|
|||
|
||||
private $tableName;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->connection = \OC_DB::getConnection();
|
||||
if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) {
|
||||
$this->markTestSkipped('DB migration tests are not supported on OCI');
|
||||
|
@ -40,8 +42,9 @@ class Migrator extends \PHPUnit_Framework_TestCase {
|
|||
$this->tableName = 'test_' . uniqid();
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
$this->connection->exec('DROP TABLE ' . $this->tableName);
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
class TestMySqlMigration extends \PHPUnit_Framework_TestCase {
|
||||
class TestMySqlMigration extends \Test\TestCase {
|
||||
|
||||
/** @var \Doctrine\DBAL\Connection */
|
||||
private $connection;
|
||||
|
@ -14,7 +14,9 @@ class TestMySqlMigration extends \PHPUnit_Framework_TestCase {
|
|||
/** @var string */
|
||||
private $tableName;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->connection = \OC_DB::getConnection();
|
||||
if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySqlPlatform) {
|
||||
$this->markTestSkipped("Test only relevant on MySql");
|
||||
|
@ -25,8 +27,9 @@ class TestMySqlMigration extends \PHPUnit_Framework_TestCase {
|
|||
$this->connection->exec("CREATE TABLE $this->tableName(b BIT, e ENUM('1','2','3','4'))");
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
$this->connection->getSchemaManager()->dropTable($this->tableName);
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testNonOCTables() {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
class TestSqliteMigration extends \PHPUnit_Framework_TestCase {
|
||||
class TestSqliteMigration extends \Test\TestCase {
|
||||
|
||||
/** @var \Doctrine\DBAL\Connection */
|
||||
private $connection;
|
||||
|
@ -14,7 +14,9 @@ class TestSqliteMigration extends \PHPUnit_Framework_TestCase {
|
|||
/** @var string */
|
||||
private $tableName;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->connection = \OC_DB::getConnection();
|
||||
if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
|
||||
$this->markTestSkipped("Test only relevant on Sqlite");
|
||||
|
@ -25,8 +27,9 @@ class TestSqliteMigration extends \PHPUnit_Framework_TestCase {
|
|||
$this->connection->exec("CREATE TABLE $this->tableName(t0 tinyint unsigned, t1 tinyint)");
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
$this->connection->getSchemaManager()->dropTable($this->tableName);
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testNonOCTables() {
|
||||
|
|
|
@ -9,13 +9,15 @@
|
|||
|
||||
use OCP\Security\ISecureRandom;
|
||||
|
||||
class Test_DBSchema extends PHPUnit_Framework_TestCase {
|
||||
class Test_DBSchema extends \Test\TestCase {
|
||||
protected $schema_file = 'static://test_db_scheme';
|
||||
protected $schema_file2 = 'static://test_db_scheme2';
|
||||
protected $table1;
|
||||
protected $table2;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$dbfile = OC::$SERVERROOT.'/tests/data/db_structure.xml';
|
||||
$dbfile2 = OC::$SERVERROOT.'/tests/data/db_structure2.xml';
|
||||
|
||||
|
@ -32,9 +34,11 @@ class Test_DBSchema extends PHPUnit_Framework_TestCase {
|
|||
$this->table2 = $r.'cntcts_cards';
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
unlink($this->schema_file);
|
||||
unlink($this->schema_file2);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
// everything in one test, they depend on each other
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
class Test_ErrorHandler extends \PHPUnit_Framework_TestCase {
|
||||
class Test_ErrorHandler extends \Test\TestCase {
|
||||
|
||||
/**
|
||||
* provide username, password combinations for testRemovePassword
|
||||
|
|
|
@ -16,7 +16,7 @@ class LongId extends \OC\Files\Storage\Temporary {
|
|||
}
|
||||
}
|
||||
|
||||
class Cache extends \PHPUnit_Framework_TestCase {
|
||||
class Cache extends \Test\TestCase {
|
||||
/**
|
||||
* @var \OC\Files\Storage\Temporary $storage ;
|
||||
*/
|
||||
|
@ -452,13 +452,17 @@ class Cache extends \PHPUnit_Framework_TestCase {
|
|||
$this->assertEquals(1, count($this->cache->getFolderContents('folder')));
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
protected function tearDown() {
|
||||
if ($this->cache) {
|
||||
$this->cache->clear();
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->storage = new \OC\Files\Storage\Temporary(array());
|
||||
$this->storage2 = new \OC\Files\Storage\Temporary(array());
|
||||
$this->cache = new \OC\Files\Cache\Cache($this->storage);
|
||||
|
|
|
@ -12,7 +12,7 @@ use OC\Files\Filesystem;
|
|||
use OC\Files\Storage\Temporary;
|
||||
use OC\Files\View;
|
||||
|
||||
class ChangePropagator extends \PHPUnit_Framework_TestCase {
|
||||
class ChangePropagator extends \Test\TestCase {
|
||||
/**
|
||||
* @var \OC\Files\Cache\ChangePropagator
|
||||
*/
|
||||
|
@ -23,9 +23,11 @@ class ChangePropagator extends \PHPUnit_Framework_TestCase {
|
|||
*/
|
||||
private $view;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$storage = new Temporary(array());
|
||||
$root = '/' . uniqid();
|
||||
$root = $this->getUniqueID('/');
|
||||
Filesystem::mount($storage, array(), $root);
|
||||
$this->view = new View($root);
|
||||
$this->propagator = new \OC\Files\Cache\ChangePropagator($this->view);
|
||||
|
|
|
@ -43,7 +43,7 @@ class DummyUser extends \OC\User\User {
|
|||
}
|
||||
}
|
||||
|
||||
class HomeCache extends \PHPUnit_Framework_TestCase {
|
||||
class HomeCache extends \Test\TestCase {
|
||||
/**
|
||||
* @var \OC\Files\Storage\Home $storage
|
||||
*/
|
||||
|
@ -59,7 +59,9 @@ class HomeCache extends \PHPUnit_Framework_TestCase {
|
|||
*/
|
||||
private $user;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->user = new DummyUser('foo', \OC_Helper::tmpFolder());
|
||||
$this->storage = new \OC\Files\Storage\Home(array('user' => $this->user));
|
||||
$this->cache = $this->storage->getCache();
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace Test\Files\Cache;
|
||||
|
||||
class Scanner extends \PHPUnit_Framework_TestCase {
|
||||
class Scanner extends \Test\TestCase {
|
||||
/**
|
||||
* @var \OC\Files\Storage\Storage $storage
|
||||
*/
|
||||
|
@ -24,16 +24,20 @@ class Scanner extends \PHPUnit_Framework_TestCase {
|
|||
*/
|
||||
private $cache;
|
||||
|
||||
function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->storage = new \OC\Files\Storage\Temporary(array());
|
||||
$this->scanner = new \OC\Files\Cache\Scanner($this->storage);
|
||||
$this->cache = new \OC\Files\Cache\Cache($this->storage);
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
protected function tearDown() {
|
||||
if ($this->cache) {
|
||||
$this->cache->clear();
|
||||
}
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
function testFile() {
|
||||
|
|
|
@ -12,7 +12,7 @@ use OC\Files\Filesystem;
|
|||
use OC\Files\Storage\Temporary;
|
||||
use OC\Files\View;
|
||||
|
||||
class Updater extends \PHPUnit_Framework_TestCase {
|
||||
class Updater extends \Test\TestCase {
|
||||
/**
|
||||
* @var \OC\Files\Storage\Storage
|
||||
*/
|
||||
|
@ -40,6 +40,7 @@ class Updater extends \PHPUnit_Framework_TestCase {
|
|||
parent::setUp();
|
||||
|
||||
$this->originalStorage = Filesystem::getStorage('/');
|
||||
|
||||
$this->storage = new Temporary(array());
|
||||
Filesystem::clearMounts();
|
||||
Filesystem::mount($this->storage, array(), '/');
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue