summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-11-07 15:23:15 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-11-19 14:52:07 +0100
commitbb540722cd4e197bd608d9a87e4b10cf66dec5a9 (patch)
treef243bae56944c4b88b2545941a6c6de1e7321f04 /apps
parent284ba5b688d7f0a9d2e1f7b9a68a7e8362be5e67 (diff)
downloadnextcloud-server-bb540722cd4e197bd608d9a87e4b10cf66dec5a9.tar.gz
nextcloud-server-bb540722cd4e197bd608d9a87e4b10cf66dec5a9.zip
Use base class to reset the file mapper
Diffstat (limited to 'apps')
-rw-r--r--apps/files/tests/helper.php4
-rw-r--r--apps/files_versions/tests/versions.php21
2 files changed, 16 insertions, 9 deletions
diff --git a/apps/files/tests/helper.php b/apps/files/tests/helper.php
index 17be1770c33..da902f4f78a 100644
--- a/apps/files/tests/helper.php
+++ b/apps/files/tests/helper.php
@@ -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
- );
+ );
}
}
diff --git a/apps/files_versions/tests/versions.php b/apps/files_versions/tests/versions.php
index a3b8595a34b..adcbb686c61 100644
--- a/apps/files_versions/tests/versions.php
+++ b/apps/files_versions/tests/versions.php
@@ -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");