[Pkg-owncloud-commits] [owncloud] 28/83: Fixed testTouch unit test to work with stable5

David Prévot taffit at moszumanska.debian.org
Wed Dec 18 13:05:27 UTC 2013


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

taffit pushed a commit to branch 5.0
in repository owncloud.

commit 6eae96b7b03bf804fbbd891533eb4a396b26ee9d
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Fri Nov 22 14:53:56 2013 +0100

    Fixed testTouch unit test to work with stable5
    
    Calling getFileInfo() would trigger checkUpdate() and would return the
    real file mtime because the test value 500 was in the past.
    
    This fix makes this test work with the stable5 behavior.
    
    Removed "storage_mtime" references which don't exist in stable5.
---
 tests/lib/files/view.php | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php
index 88b4113..aceb36a 100644
--- a/tests/lib/files/view.php
+++ b/tests/lib/files/view.php
@@ -275,18 +275,20 @@ class View extends \PHPUnit_Framework_TestCase {
 
 		$rootView = new \OC\Files\View('');
 		$oldCachedData = $rootView->getFileInfo('foo.txt');
+		$newMTime = $oldCachedData['mtime'] + 500;
 
-		$rootView->touch('foo.txt', 500);
+		$rootView->touch('foo.txt', $newMTime);
 
 		$cachedData = $rootView->getFileInfo('foo.txt');
-		$this->assertEquals(500, $cachedData['mtime']);
-		$this->assertEquals($oldCachedData['storage_mtime'], $cachedData['storage_mtime']);
+		$this->assertEquals($newMTime, $cachedData['mtime']);
+
+		// reset mtime to original to make sure the next file access
+		// gets a higher mtime
+		$rootView->touch('foo.txt', $oldCachedData['mtime']);
 
-		$rootView->putFileInfo('foo.txt', array('storage_mtime' => 1000)); //make sure the watcher detects the change
 		$rootView->file_put_contents('foo.txt', 'asd');
 		$cachedData = $rootView->getFileInfo('foo.txt');
 		$this->assertGreaterThanOrEqual($cachedData['mtime'], $oldCachedData['mtime']);
-		$this->assertEquals($cachedData['storage_mtime'], $cachedData['mtime']);
 	}
 
 	/**

-- 
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