diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-11-22 17:53:56 +0400 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-11-22 17:53:56 +0400 |
commit | 6eae96b7b03bf804fbbd891533eb4a396b26ee9d (patch) | |
tree | a6bf0c3655b0d634719c9687ef84c76c2ddf6bd9 /tests | |
parent | 64b484e32e2d16736a8bacc86980026deefcf42a (diff) |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/view.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php index 88b4113008b..aceb36aa01e 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']); } /** |