File tree Expand file tree Collapse file tree 3 files changed +13
-13
lines changed
apps/dav/tests/unit/Connector/Sabre Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 2929namespace OCA \DAV \Tests \Unit \Connector \Sabre ;
3030
3131use OC \Files \FileInfo ;
32+ use OC \Files \Node \Node ;
3233use OC \Files \Storage \Wrapper \Quota ;
3334use OCA \DAV \Connector \Sabre \Directory ;
3435use OCP \Files \ForbiddenException ;
@@ -82,9 +83,10 @@ protected function setUp(): void {
8283
8384 $ this ->view = $ this ->createMock ('OC\Files\View ' );
8485 $ this ->info = $ this ->createMock ('OC\Files\FileInfo ' );
85- $ this ->info ->expects ($ this ->any ())
86- ->method ('isReadable ' )
86+ $ this ->info ->method ('isReadable ' )
8787 ->willReturn (true );
88+ $ this ->info ->method ('getType ' )
89+ ->willReturn (Node::TYPE_FOLDER );
8890 }
8991
9092 private function getDir ($ path = '/ ' ) {
Original file line number Diff line number Diff line change @@ -167,17 +167,14 @@ public function testGetNodeForPath(
167167 $ fileInfo = $ this ->getMockBuilder (FileInfo::class)
168168 ->disableOriginalConstructor ()
169169 ->getMock ();
170- $ fileInfo ->expects ($ this ->once ())
171- ->method ('getType ' )
170+ $ fileInfo ->method ('getType ' )
172171 ->willReturn ($ type );
173- $ fileInfo ->expects ($ this ->once ())
174- ->method ('getName ' )
172+ $ fileInfo ->method ('getName ' )
175173 ->willReturn ($ outputFileName );
176174 $ fileInfo ->method ('getStorage ' )
177175 ->willReturn ($ this ->createMock (\OC \Files \Storage \Common::class));
178176
179- $ view ->expects ($ this ->once ())
180- ->method ('getFileInfo ' )
177+ $ view ->method ('getFileInfo ' )
181178 ->with ($ fileInfoQueryPath )
182179 ->willReturn ($ fileInfo );
183180
Original file line number Diff line number Diff line change @@ -111,9 +111,7 @@ public function testGetProperties($shareTypes) {
111111 ->disableOriginalConstructor ()
112112 ->getMock ();
113113
114- $ this ->userFolder ->expects ($ this ->once ())
115- ->method ('get ' )
116- ->with ('/subdir ' )
114+ $ sabreNode ->method ('getNode ' )
117115 ->willReturn ($ node );
118116
119117 $ this ->shareManager ->expects ($ this ->any ())
@@ -187,9 +185,12 @@ public function testPreloadThenGetProperties($shareTypes) {
187185 $ node2 ->method ('getId ' )
188186 ->willReturn (222 );
189187
190- $ this ->userFolder ->method ('get ' )
191- ->with ('/subdir ' )
188+ $ sabreNode ->method ('getNode ' )
192189 ->willReturn ($ node );
190+ $ sabreNode1 ->method ('getNode ' )
191+ ->willReturn ($ node1 );
192+ $ sabreNode2 ->method ('getNode ' )
193+ ->willReturn ($ node2 );
193194
194195 $ dummyShares = array_map (function ($ type ) {
195196 $ share = $ this ->getMockBuilder (IShare::class)->getMock ();
You can’t perform that action at this time.
0 commit comments