Add a test for getting the versions of an empty path
This commit is contained in:
parent
05fe2006ee
commit
2b092f2e93
|
@ -411,7 +411,7 @@ class Test_Files_Versioning extends \Test\TestCase {
|
||||||
// execute copy hook of versions app
|
// execute copy hook of versions app
|
||||||
$versions = \OCA\Files_Versions\Storage::getVersions(self::TEST_VERSIONS_USER, '/subfolder/test.txt');
|
$versions = \OCA\Files_Versions\Storage::getVersions(self::TEST_VERSIONS_USER, '/subfolder/test.txt');
|
||||||
|
|
||||||
$this->assertSame(2, count($versions));
|
$this->assertCount(2, $versions);
|
||||||
|
|
||||||
foreach ($versions as $version) {
|
foreach ($versions as $version) {
|
||||||
$this->assertSame('/subfolder/test.txt', $version['path']);
|
$this->assertSame('/subfolder/test.txt', $version['path']);
|
||||||
|
@ -422,6 +422,17 @@ class Test_Files_Versioning extends \Test\TestCase {
|
||||||
$this->rootView->deleteAll(self::USERS_VERSIONS_ROOT . '/subfolder');
|
$this->rootView->deleteAll(self::USERS_VERSIONS_ROOT . '/subfolder');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test if we find all versions and if the versions array contain
|
||||||
|
* the correct 'path' and 'name'
|
||||||
|
*/
|
||||||
|
public function testGetVersionsEmptyFile() {
|
||||||
|
// execute copy hook of versions app
|
||||||
|
$versions = \OCA\Files_Versions\Storage::getVersions(self::TEST_VERSIONS_USER, '');
|
||||||
|
|
||||||
|
$this->assertCount(0, $versions);
|
||||||
|
}
|
||||||
|
|
||||||
public function testRestoreSameStorage() {
|
public function testRestoreSameStorage() {
|
||||||
\OC\Files\Filesystem::mkdir('sub');
|
\OC\Files\Filesystem::mkdir('sub');
|
||||||
$this->doTestRestore();
|
$this->doTestRestore();
|
||||||
|
|
Loading…
Reference in New Issue