]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix unit test
authorRobin Appelman <icewind@owncloud.com>
Mon, 4 Aug 2014 14:17:11 +0000 (16:17 +0200)
committerRobin Appelman <icewind@owncloud.com>
Fri, 5 Sep 2014 09:53:23 +0000 (11:53 +0200)
tests/lib/connector/sabre/file.php
tests/lib/files/cache/updaterlegacy.php
tests/lib/files/view.php

index ba4e775813b16e54fb481015e0e719e8ea3d369b..f9f485a54004efcd1198865db1c42f5e49fecb74 100644 (file)
@@ -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()
@@ -72,7 +71,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));
@@ -96,7 +95,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')
@@ -115,8 +114,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()
index a6697c7635362b04e047f047ddbf8dd9fc8e0518..deb4cb0b43838c2b713299ebdbeb985f05dc20e7 100644 (file)
@@ -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']);
index a0f4d97d5b4a39d69fe8b3d206847cce0dc0be09..522535946a536ff25417e2c7f89d71b5bc53d927 100644 (file)
@@ -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']);
        }