diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-07-30 13:04:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-30 13:04:15 +0200 |
commit | 21f558b12bdb985ec312ac8973f2be9c0d73f824 (patch) | |
tree | 5c09ea1a8ad508986e9152109955ea7c5c28a187 /tests | |
parent | b9f35a73151ef1bd42959d4b39268856deca2f0c (diff) | |
parent | cf935e33ae08f49fec42ec5bc9ceca2d8830ef4b (diff) | |
download | nextcloud-server-21f558b12bdb985ec312ac8973f2be9c0d73f824.tar.gz nextcloud-server-21f558b12bdb985ec312ac8973f2be9c0d73f824.zip |
Merge pull request #46379 from nextcloud/fix/folder-search-owner
fix: `OCP\Files\Node\Folder::search` was not setting the owner
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Files/Node/FolderTest.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/lib/Files/Node/FolderTest.php b/tests/lib/Files/Node/FolderTest.php index 546c9f84a1a..46fda6c3a76 100644 --- a/tests/lib/Files/Node/FolderTest.php +++ b/tests/lib/Files/Node/FolderTest.php @@ -29,6 +29,7 @@ use OCP\Files\NotFoundException; use OCP\Files\Search\ISearchComparison; use OCP\Files\Search\ISearchOrder; use OCP\Files\Storage; +use PHPUnit\Framework\MockObject\MockObject; /** * Class FolderTest @@ -290,7 +291,7 @@ class FolderTest extends NodeTest { ->getMock(); $root->method('getUser') ->willReturn($this->user); - /** @var Storage\IStorage $storage */ + /** @var Storage\IStorage&MockObject $storage */ $storage = $this->createMock(Storage\IStorage::class); $storage->method('getId')->willReturn('test::1'); $cache = new Cache($storage); @@ -298,10 +299,17 @@ class FolderTest extends NodeTest { $storage->method('getCache') ->willReturn($cache); + $storage->expects($this->atLeastOnce()) + ->method('getOwner') + ->with('qwerty') + ->willReturn(false); + $mount = $this->createMock(IMountPoint::class); - $mount->method('getStorage') + $mount->expects($this->atLeastOnce()) + ->method('getStorage') ->willReturn($storage); - $mount->method('getInternalPath') + $mount->expects($this->atLeastOnce()) + ->method('getInternalPath') ->willReturn('foo'); $cache->insert('foo', ['size' => 200, 'mtime' => 55, 'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE]); |