summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-05-07 16:02:35 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-05-07 16:02:35 +0200
commit2b092f2e9339693f2894a2f056383f1623fad797 (patch)
treee831702e710d1d1397b992e3959870d837c9c52e
parent05fe2006ee227a6097fa5804cd32db1a57b8672a (diff)
downloadnextcloud-server-2b092f2e9339693f2894a2f056383f1623fad797.tar.gz
nextcloud-server-2b092f2e9339693f2894a2f056383f1623fad797.zip
Add a test for getting the versions of an empty path
-rw-r--r--apps/files_versions/tests/versions.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/files_versions/tests/versions.php b/apps/files_versions/tests/versions.php
index 5ea6d9ee5b9..febde951411 100644
--- a/apps/files_versions/tests/versions.php
+++ b/apps/files_versions/tests/versions.php
@@ -411,7 +411,7 @@ class Test_Files_Versioning extends \Test\TestCase {
// execute copy hook of versions app
$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) {
$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');
}
+ /**
+ * 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() {
\OC\Files\Filesystem::mkdir('sub');
$this->doTestRestore();