diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-07-09 18:33:45 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-07-30 11:06:30 +0000 |
commit | 264074c16136d0242927969f441fce094b6b2b39 (patch) | |
tree | 8e75429790f14659ecac58ca755a800b402393c3 /tests | |
parent | 339a01049a497a83d94d97b2c52e5e55a8e31f7b (diff) | |
download | nextcloud-server-264074c16136d0242927969f441fce094b6b2b39.tar.gz nextcloud-server-264074c16136d0242927969f441fce094b6b2b39.zip |
fix: `OCP\Files\Node\Folder::search` was not setting the owner
The owner was not set on the file info causing e.g. webdav searches to never return the known owner.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
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 a219222d008..1d94cd195bc 100644 --- a/tests/lib/Files/Node/FolderTest.php +++ b/tests/lib/Files/Node/FolderTest.php @@ -30,6 +30,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 @@ -291,7 +292,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); @@ -299,10 +300,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]); |