diff options
author | Louis Chemineau <louis@chmn.me> | 2024-11-21 17:13:24 +0100 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2024-11-21 17:13:24 +0100 |
commit | f9cda54cbf5559372b0e9e22dac41483c18a6988 (patch) | |
tree | f59c974c784322a7d24675c38f9758b62a7d7961 /tests/lib | |
parent | 16812837157395c078a9689cd51530a6382e17d2 (diff) | |
download | nextcloud-server-f9cda54cbf5559372b0e9e22dac41483c18a6988.tar.gz nextcloud-server-f9cda54cbf5559372b0e9e22dac41483c18a6988.zip |
fix: Wrap partial cache entry in CacheEntryartonge/fix/getting_cache_entry
Because it is returned here: https://github.com/nextcloud/server/blob/7b7d07c5750583ab3a7b29112af475f5c8891143/lib/private/Files/Cache/Cache.php#L136-L137
And some implementation got stricter: https://github.com/nextcloud/groupfolders/blob/df95bf6ba807da5171de91108879b6d8aa9f3611/lib/Mount/RootEntryCache.php#L23-L28
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/Files/Cache/CacheTest.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/lib/Files/Cache/CacheTest.php b/tests/lib/Files/Cache/CacheTest.php index d1279af29ad..204f87d6a18 100644 --- a/tests/lib/Files/Cache/CacheTest.php +++ b/tests/lib/Files/Cache/CacheTest.php @@ -8,6 +8,7 @@ namespace Test\Files\Cache; use OC\Files\Cache\Cache; +use OC\Files\Cache\CacheEntry; use OC\Files\Search\SearchComparison; use OC\Files\Search\SearchQuery; use OCP\EventDispatcher\IEventDispatcher; @@ -127,13 +128,13 @@ class CacheTest extends \Test\TestCase { $file1 = 'foo'; $this->cache->put($file1, ['size' => 10]); - $this->assertEquals(['size' => 10], $this->cache->get($file1)); + $this->assertEquals(new CacheEntry(['size' => 10]), $this->cache->get($file1)); $this->cache->put($file1, ['mtime' => 15]); - $this->assertEquals(['size' => 10, 'mtime' => 15], $this->cache->get($file1)); + $this->assertEquals(new CacheEntry(['size' => 10, 'mtime' => 15]), $this->cache->get($file1)); $this->cache->put($file1, ['size' => 12]); - $this->assertEquals(['size' => 12, 'mtime' => 15], $this->cache->get($file1)); + $this->assertEquals(new CacheEntry(['size' => 12, 'mtime' => 15]), $this->cache->get($file1)); } /** |