]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix tests 2068/head
authorRobin Appelman <robin@icewind.nl>
Thu, 10 Nov 2016 14:06:24 +0000 (15:06 +0100)
committerRobin Appelman <robin@icewind.nl>
Thu, 10 Nov 2016 14:06:24 +0000 (15:06 +0100)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php

index 2e17c7d0b384ecd40884cb25e9843321d1dc5629..9d8a66f24b607a2bd5066bff783c39df7b63f392 100644 (file)
@@ -97,7 +97,7 @@ class SharesPluginTest extends \Test\TestCase {
                $sabreNode->expects($this->any())
                        ->method('getId')
                        ->will($this->returnValue(123));
-               $sabreNode->expects($this->once())
+               $sabreNode->expects($this->any())
                        ->method('getPath')
                        ->will($this->returnValue('/subdir'));
 
@@ -155,7 +155,7 @@ class SharesPluginTest extends \Test\TestCase {
                $sabreNode1->expects($this->any())
                        ->method('getId')
                        ->will($this->returnValue(111));
-               $sabreNode1->expects($this->never())
+               $sabreNode1->expects($this->any())
                        ->method('getPath');
                $sabreNode2 = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\File')
                        ->disableOriginalConstructor()
@@ -163,8 +163,9 @@ class SharesPluginTest extends \Test\TestCase {
                $sabreNode2->expects($this->any())
                        ->method('getId')
                        ->will($this->returnValue(222));
-               $sabreNode2->expects($this->never())
-                       ->method('getPath');
+               $sabreNode2->expects($this->any())
+                       ->method('getPath')
+                       ->will($this->returnValue('/subdir/foo'));
 
                $sabreNode = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Directory')
                        ->disableOriginalConstructor()
@@ -198,9 +199,6 @@ class SharesPluginTest extends \Test\TestCase {
                $node2->expects($this->any())
                        ->method('getId')
                        ->will($this->returnValue(222));
-               $node->expects($this->once())
-                       ->method('getDirectoryListing')
-                       ->will($this->returnValue([$node1, $node2]));
 
                $this->userFolder->expects($this->once())
                        ->method('get')
@@ -208,7 +206,7 @@ class SharesPluginTest extends \Test\TestCase {
                        ->will($this->returnValue($node));
                
                $dummyShares = array_map(function($type) {
-                       $share = $this->getMock('\OCP\Share\IShare');
+                       $share = $this->getMockBuilder('\OCP\Share\IShare')->getMock();
                        $share->expects($this->any())
                                ->method('getShareType')
                                ->will($this->returnValue($type));