|
|
|
@ -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"); |
|
|
|
|
|
|
|
|
|