[Pkg-owncloud-commits] [owncloud] 16/34: Fix unit test

David Prévot taffit at moszumanska.debian.org
Fri Oct 17 01:32:16 UTC 2014


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

taffit pushed a commit to branch master
in repository owncloud.

commit ad6e281586b4de263c0a3b4f18641af9e5b7f73b
Author: Robin Appelman <icewind at owncloud.com>
Date:   Mon Aug 4 16:17:11 2014 +0200

    Fix unit test
---
 tests/lib/connector/sabre/file.php      | 12 +++++-------
 tests/lib/files/cache/updaterlegacy.php |  1 -
 tests/lib/files/view.php                |  2 +-
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/tests/lib/connector/sabre/file.php b/tests/lib/connector/sabre/file.php
index 2ce69d7..0993a27 100644
--- a/tests/lib/connector/sabre/file.php
+++ b/tests/lib/connector/sabre/file.php
@@ -13,7 +13,7 @@ class Test_OC_Connector_Sabre_File extends PHPUnit_Framework_TestCase {
 	 */
 	public function testSimplePutFails() {
 		// setup
-		$view = $this->getMock('\OC\Files\View', array('file_put_contents', 'getRelativePath'), array(), '', false);
+		$view = $this->getMock('\OC\Files\View', array('file_put_contents', 'getRelativePath'), array());
 		$view->expects($this->any())
 			->method('file_put_contents')
 			->will($this->returnValue(false));
@@ -38,8 +38,7 @@ class Test_OC_Connector_Sabre_File extends PHPUnit_Framework_TestCase {
 	public function testSimplePutFailsOnRename() {
 		// setup
 		$view = $this->getMock('\OC\Files\View',
-			array('file_put_contents', 'rename', 'getRelativePath', 'filesize'),
-			array(), '', false);
+			array('file_put_contents', 'rename', 'getRelativePath', 'filesize'));
 		$view->expects($this->any())
 			->method('file_put_contents')
 			->withAnyParameters()
@@ -73,7 +72,7 @@ class Test_OC_Connector_Sabre_File extends PHPUnit_Framework_TestCase {
 	 */
 	public function testSimplePutInvalidChars() {
 		// setup
-		$view = $this->getMock('\OC\Files\View', array('file_put_contents', 'getRelativePath'), array(), '', false);
+		$view = $this->getMock('\OC\Files\View', array('file_put_contents', 'getRelativePath'));
 		$view->expects($this->any())
 			->method('file_put_contents')
 			->will($this->returnValue(false));
@@ -97,7 +96,7 @@ class Test_OC_Connector_Sabre_File extends PHPUnit_Framework_TestCase {
 	 */
 	public function testSetNameInvalidChars() {
 		// setup
-		$view = $this->getMock('\OC\Files\View', array('getRelativePath'), array(), '', false);
+		$view = $this->getMock('\OC\Files\View', array('getRelativePath'));
 
 		$view->expects($this->any())
 			->method('getRelativePath')
@@ -116,8 +115,7 @@ class Test_OC_Connector_Sabre_File extends PHPUnit_Framework_TestCase {
 	public function testUploadAbort() {
 		// setup
 		$view = $this->getMock('\OC\Files\View',
-			array('file_put_contents', 'rename', 'getRelativePath', 'filesize'),
-			array(), '', false);
+			array('file_put_contents', 'rename', 'getRelativePath', 'filesize'));
 		$view->expects($this->any())
 			->method('file_put_contents')
 			->withAnyParameters()
diff --git a/tests/lib/files/cache/updaterlegacy.php b/tests/lib/files/cache/updaterlegacy.php
index a6697c7..deb4cb0 100644
--- a/tests/lib/files/cache/updaterlegacy.php
+++ b/tests/lib/files/cache/updaterlegacy.php
@@ -132,7 +132,6 @@ class UpdaterLegacy extends \PHPUnit_Framework_TestCase {
 		$this->assertInternalType('string', $substorageCachedData['etag']);
 		$this->assertInternalType('string', $cachedData['etag']);
 		$this->assertNotSame($substorageCachedData['etag'], $cachedData['etag']);
-		$this->assertEquals($mtime, $cachedData['mtime']);
 
 		$cachedData = $this->cache->get('folder');
 		$this->assertInternalType('string', $folderCachedData['etag']);
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php
index a0f4d97..5225359 100644
--- a/tests/lib/files/view.php
+++ b/tests/lib/files/view.php
@@ -382,7 +382,7 @@ class View extends \PHPUnit_Framework_TestCase {
 		$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->assertGreaterThanOrEqual($oldCachedData['mtime'], $cachedData['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