[Pkg-owncloud-commits] [owncloud] 15/123: Add a test for getting the versions of an empty path

David Prévot taffit at moszumanska.debian.org
Tue May 19 23:55:08 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 2b092f2e9339693f2894a2f056383f1623fad797
Author: Joas Schilling <nickvergessen at owncloud.com>
Date:   Thu May 7 16:02:35 2015 +0200

    Add a test for getting the versions of an empty path
---
 apps/files_versions/tests/versions.php | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/apps/files_versions/tests/versions.php b/apps/files_versions/tests/versions.php
index 5ea6d9e..febde95 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();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list