From bb540722cd4e197bd608d9a87e4b10cf66dec5a9 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 7 Nov 2014 15:23:15 +0100 Subject: Use base class to reset the file mapper --- apps/files_versions/tests/versions.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'apps/files_versions/tests') 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"); -- cgit v1.2.3