summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_sharing/tests/backend.php6
-rw-r--r--apps/files_sharing/tests/external/cache.php4
-rw-r--r--apps/files_sharing/tests/sharedmount.php6
-rw-r--r--apps/files_sharing/tests/updater.php6
-rw-r--r--apps/files_sharing/tests/watcher.php12
-rw-r--r--apps/files_versions/tests/versions.php10
6 files changed, 28 insertions, 16 deletions
diff --git a/apps/files_sharing/tests/backend.php b/apps/files_sharing/tests/backend.php
index 0e151d9e76a..acb59855394 100644
--- a/apps/files_sharing/tests/backend.php
+++ b/apps/files_sharing/tests/backend.php
@@ -58,8 +58,10 @@ class Test_Files_Sharing_Backend extends TestCase {
}
protected function tearDown() {
- $this->view->unlink($this->filename);
- $this->view->deleteAll($this->folder);
+ if ($this->view) {
+ $this->view->unlink($this->filename);
+ $this->view->deleteAll($this->folder);
+ }
parent::tearDown();
}
diff --git a/apps/files_sharing/tests/external/cache.php b/apps/files_sharing/tests/external/cache.php
index 52e01677fa3..3e078bf3722 100644
--- a/apps/files_sharing/tests/external/cache.php
+++ b/apps/files_sharing/tests/external/cache.php
@@ -75,7 +75,9 @@ class Cache extends TestCase {
}
protected function tearDown() {
- $this->cache->clear();
+ if ($this->cache) {
+ $this->cache->clear();
+ }
parent::tearDown();
}
diff --git a/apps/files_sharing/tests/sharedmount.php b/apps/files_sharing/tests/sharedmount.php
index 347ec0d2a7b..e01deeb60f4 100644
--- a/apps/files_sharing/tests/sharedmount.php
+++ b/apps/files_sharing/tests/sharedmount.php
@@ -48,8 +48,10 @@ class Test_Files_Sharing_Mount extends OCA\Files_sharing\Tests\TestCase {
}
protected function tearDown() {
- $this->view->unlink($this->folder);
- $this->view->unlink($this->filename);
+ if ($this->view) {
+ $this->view->unlink($this->folder);
+ $this->view->unlink($this->filename);
+ }
parent::tearDown();
}
diff --git a/apps/files_sharing/tests/updater.php b/apps/files_sharing/tests/updater.php
index 02c5f487e0a..dd1f83c99a8 100644
--- a/apps/files_sharing/tests/updater.php
+++ b/apps/files_sharing/tests/updater.php
@@ -52,8 +52,10 @@ class Test_Files_Sharing_Updater extends OCA\Files_Sharing\Tests\TestCase {
}
protected function tearDown() {
- $this->view->unlink($this->filename);
- $this->view->deleteAll($this->folder);
+ if ($this->view) {
+ $this->view->unlink($this->filename);
+ $this->view->deleteAll($this->folder);
+ }
parent::tearDown();
}
diff --git a/apps/files_sharing/tests/watcher.php b/apps/files_sharing/tests/watcher.php
index 021f10bacca..247fb59f351 100644
--- a/apps/files_sharing/tests/watcher.php
+++ b/apps/files_sharing/tests/watcher.php
@@ -88,13 +88,15 @@ class Test_Files_Sharing_Watcher extends OCA\Files_sharing\Tests\TestCase {
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
- $fileinfo = $this->view->getFileInfo('container/shareddir');
- \OCP\Share::unshare('folder', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
- self::TEST_FILES_SHARING_API_USER2);
+ if ($this->view) {
+ $fileinfo = $this->view->getFileInfo('container/shareddir');
+ \OCP\Share::unshare('folder', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
+ self::TEST_FILES_SHARING_API_USER2);
- $this->view->deleteAll('container');
+ $this->view->deleteAll('container');
- $this->ownerCache->clear();
+ $this->ownerCache->clear();
+ }
parent::tearDown();
}
diff --git a/apps/files_versions/tests/versions.php b/apps/files_versions/tests/versions.php
index 74d6006cfd9..ac922b74b9f 100644
--- a/apps/files_versions/tests/versions.php
+++ b/apps/files_versions/tests/versions.php
@@ -86,10 +86,12 @@ class Test_Files_Versioning extends \Test\TestCase {
}
protected function tearDown() {
- $this->rootView->deleteAll(self::TEST_VERSIONS_USER . '/files/');
- $this->rootView->deleteAll(self::TEST_VERSIONS_USER2 . '/files/');
- $this->rootView->deleteAll(self::TEST_VERSIONS_USER . '/files_versions/');
- $this->rootView->deleteAll(self::TEST_VERSIONS_USER2 . '/files_versions/');
+ if ($this->rootView) {
+ $this->rootView->deleteAll(self::TEST_VERSIONS_USER . '/files/');
+ $this->rootView->deleteAll(self::TEST_VERSIONS_USER2 . '/files/');
+ $this->rootView->deleteAll(self::TEST_VERSIONS_USER . '/files_versions/');
+ $this->rootView->deleteAll(self::TEST_VERSIONS_USER2 . '/files_versions/');
+ }
\OC_Hook::clear();