aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r--apps/files_sharing/tests/api.php4
-rw-r--r--apps/files_sharing/tests/backend.php4
-rw-r--r--apps/files_sharing/tests/cache.php4
-rw-r--r--apps/files_sharing/tests/externalstorage.php2
-rw-r--r--apps/files_sharing/tests/permissions.php4
-rw-r--r--apps/files_sharing/tests/proxy.php4
-rw-r--r--apps/files_sharing/tests/share.php4
-rw-r--r--apps/files_sharing/tests/sharedmount.php4
-rw-r--r--apps/files_sharing/tests/sharedstorage.php4
-rw-r--r--apps/files_sharing/tests/testcase.php13
-rw-r--r--apps/files_sharing/tests/updater.php4
-rw-r--r--apps/files_sharing/tests/watcher.php4
12 files changed, 30 insertions, 25 deletions
diff --git a/apps/files_sharing/tests/api.php b/apps/files_sharing/tests/api.php
index 453133fee31..e550dcc27db 100644
--- a/apps/files_sharing/tests/api.php
+++ b/apps/files_sharing/tests/api.php
@@ -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);
diff --git a/apps/files_sharing/tests/backend.php b/apps/files_sharing/tests/backend.php
index e113c940678..5cf2a22c792 100644
--- a/apps/files_sharing/tests/backend.php
+++ b/apps/files_sharing/tests/backend.php
@@ -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);
diff --git a/apps/files_sharing/tests/cache.php b/apps/files_sharing/tests/cache.php
index 0e96f5a4e09..b6a44f464f9 100644
--- a/apps/files_sharing/tests/cache.php
+++ b/apps/files_sharing/tests/cache.php
@@ -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);
diff --git a/apps/files_sharing/tests/externalstorage.php b/apps/files_sharing/tests/externalstorage.php
index 0c741bb8199..cf82fcfc555 100644
--- a/apps/files_sharing/tests/externalstorage.php
+++ b/apps/files_sharing/tests/externalstorage.php
@@ -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(
diff --git a/apps/files_sharing/tests/permissions.php b/apps/files_sharing/tests/permissions.php
index 639ebfb5936..f72d724c6fe 100644
--- a/apps/files_sharing/tests/permissions.php
+++ b/apps/files_sharing/tests/permissions.php
@@ -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);
diff --git a/apps/files_sharing/tests/proxy.php b/apps/files_sharing/tests/proxy.php
index 68cd81f963a..31acf9b27de 100644
--- a/apps/files_sharing/tests/proxy.php
+++ b/apps/files_sharing/tests/proxy.php
@@ -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;
diff --git a/apps/files_sharing/tests/share.php b/apps/files_sharing/tests/share.php
index 2b5978f8e57..4318d3c510e 100644
--- a/apps/files_sharing/tests/share.php
+++ b/apps/files_sharing/tests/share.php
@@ -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);
diff --git a/apps/files_sharing/tests/sharedmount.php b/apps/files_sharing/tests/sharedmount.php
index 6d155f174ba..dd66ca05d38 100644
--- a/apps/files_sharing/tests/sharedmount.php
+++ b/apps/files_sharing/tests/sharedmount.php
@@ -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);
diff --git a/apps/files_sharing/tests/sharedstorage.php b/apps/files_sharing/tests/sharedstorage.php
index ab15e8fe3ba..75373244508 100644
--- a/apps/files_sharing/tests/sharedstorage.php
+++ b/apps/files_sharing/tests/sharedstorage.php
@@ -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);
diff --git a/apps/files_sharing/tests/testcase.php b/apps/files_sharing/tests/testcase.php
index 034baa785da..65fbfac7d1d 100644
--- a/apps/files_sharing/tests/testcase.php
+++ b/apps/files_sharing/tests/testcase.php
@@ -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();
}
/**
diff --git a/apps/files_sharing/tests/updater.php b/apps/files_sharing/tests/updater.php
index 861516dff7f..bc8deaf19b0 100644
--- a/apps/files_sharing/tests/updater.php
+++ b/apps/files_sharing/tests/updater.php
@@ -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);
diff --git a/apps/files_sharing/tests/watcher.php b/apps/files_sharing/tests/watcher.php
index 67f55394ae8..254b30c6470 100644
--- a/apps/files_sharing/tests/watcher.php
+++ b/apps/files_sharing/tests/watcher.php
@@ -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);