diff options
author | Robin Appelman <robin@icewind.nl> | 2019-01-22 17:28:57 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2019-02-07 15:51:34 +0100 |
commit | 0ccd970f9d7c154dc4c2aedcbedd6658ca69a1c3 (patch) | |
tree | c974edca942f89b870fc125ba9d5b51a0c6dd9cd /tests | |
parent | 748bcd407b4079adeceff3455749ad1e4d316c9d (diff) | |
download | nextcloud-server-0ccd970f9d7c154dc4c2aedcbedd6658ca69a1c3.tar.gz nextcloud-server-0ccd970f9d7c154dc4c2aedcbedd6658ca69a1c3.zip |
adjust tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Files/Node/FolderTest.php | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/tests/lib/Files/Node/FolderTest.php b/tests/lib/Files/Node/FolderTest.php index 2c87b645dd9..e1ee96c37ec 100644 --- a/tests/lib/Files/Node/FolderTest.php +++ b/tests/lib/Files/Node/FolderTest.php @@ -290,7 +290,8 @@ class FolderTest extends NodeTest { ->method('getUser') ->will($this->returnValue($this->user)); $storage = $this->createMock(Storage::class); - $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([''])->getMock(); + $storage->method('getId')->willReturn(''); + $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); $storage->expects($this->once()) ->method('getCache') @@ -340,8 +341,10 @@ class FolderTest extends NodeTest { $root->expects($this->any()) ->method('getUser') ->will($this->returnValue($this->user)); + /** @var \PHPUnit_Framework_MockObject_MockObject|Storage $storage */ $storage = $this->createMock(Storage::class); - $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([''])->getMock(); + $storage->method('getId')->willReturn(''); + $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); $mount = $this->createMock(IMountPoint::class); $mount->expects($this->once()) @@ -391,7 +394,8 @@ class FolderTest extends NodeTest { ->method('getUser') ->will($this->returnValue($this->user)); $storage = $this->createMock(Storage::class); - $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([''])->getMock(); + $storage->method('getId')->willReturn(''); + $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); $mount = $this->createMock(IMountPoint::class); $mount->expects($this->once()) @@ -441,7 +445,8 @@ class FolderTest extends NodeTest { ->method('getUser') ->will($this->returnValue($this->user)); $storage = $this->createMock(Storage::class); - $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([''])->getMock(); + $storage->method('getId')->willReturn(''); + $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); $mount = $this->createMock(IMountPoint::class); $mount->expects($this->once()) @@ -491,8 +496,9 @@ class FolderTest extends NodeTest { ->method('getUser') ->will($this->returnValue($this->user)); $storage = $this->createMock(Storage::class); - $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([''])->getMock(); - $subCache = $this->getMockBuilder(Cache::class)->setConstructorArgs([''])->getMock(); + $storage->method('getId')->willReturn(''); + $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); + $subCache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); $subStorage = $this->createMock(Storage::class); $subMount = $this->getMockBuilder(MountPoint::class)->setConstructorArgs([null, ''])->getMock(); @@ -572,7 +578,8 @@ class FolderTest extends NodeTest { ->getMock(); $storage = $this->createMock(\OC\Files\Storage\Storage::class); $mount = new MountPoint($storage, '/bar'); - $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([''])->getMock(); + $storage->method('getId')->willReturn(''); + $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); $fileInfo = new CacheEntry(['path' => 'foo/qwerty', 'mimetype' => 'text/plain'], null); @@ -625,7 +632,8 @@ class FolderTest extends NodeTest { ->getMock(); $storage = $this->createMock(\OC\Files\Storage\Storage::class); $mount = new MountPoint($storage, '/bar'); - $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([''])->getMock(); + $storage->method('getId')->willReturn(''); + $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); $fileInfo = new CacheEntry(['path' => '', 'mimetype' => 'text/plain'], null); @@ -673,7 +681,8 @@ class FolderTest extends NodeTest { ->getMock(); $storage = $this->createMock(\OC\Files\Storage\Storage::class); $mount = new MountPoint($storage, '/bar'); - $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([''])->getMock(); + $storage->method('getId')->willReturn(''); + $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); $fileInfo = new CacheEntry(['path' => 'foobar', 'mimetype' => 'text/plain'], null); @@ -726,7 +735,8 @@ class FolderTest extends NodeTest { $storage = $this->createMock(\OC\Files\Storage\Storage::class); $mount1 = new MountPoint($storage, '/bar'); $mount2 = new MountPoint($storage, '/bar/foo/asd'); - $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([''])->getMock(); + $storage->method('getId')->willReturn(''); + $cache = $this->getMockBuilder(Cache::class)->setConstructorArgs([$storage])->getMock(); $fileInfo = new CacheEntry(['path' => 'foo/qwerty', 'mimetype' => 'text/plain'], null); |