aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoeland Douma <rullzer@users.noreply.github.com>2016-05-24 14:19:27 +0200
committerVincent Petry <pvince81@owncloud.com>2016-05-24 14:19:27 +0200
commit013031410233d701afebf59a1d68ab088d8bf7b9 (patch)
treee0916dc06bf2123879c4c77f98c32e3516e249d3 /tests
parent36aa4e8aea16ead7326f8951ba98bbf6c7fbf67a (diff)
downloadnextcloud-server-013031410233d701afebf59a1d68ab088d8bf7b9.tar.gz
nextcloud-server-013031410233d701afebf59a1d68ab088d8bf7b9.zip
[Stable8.2] Use a CappedCache in the user database backend (#24413)
* Use a CappedCache in the user database backend When running with a user database backend on large installations the cache can grow to significant sizes. This can be especially problematic when running big cron/repair jobs. * Allow indirect set in CappedMemoryCache
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/cache/cappedmemorycache.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/lib/cache/cappedmemorycache.php b/tests/lib/cache/cappedmemorycache.php
index 5444d928421..a8fb273b80a 100644
--- a/tests/lib/cache/cappedmemorycache.php
+++ b/tests/lib/cache/cappedmemorycache.php
@@ -64,4 +64,16 @@ class CappedMemoryCache extends \Test_Cache {
$this->assertFalse($this->instance->hasKey('2_value1'));
$this->assertFalse($this->instance->hasKey('3_value1'));
}
+
+ function testIndirectSet() {
+ $this->instance->set('array', []);
+
+ $this->instance['array'][] = 'foo';
+
+ $this->assertEquals(['foo'], $this->instance->get('array'));
+
+ $this->instance['array']['bar'] = 'qwerty';
+
+ $this->assertEquals(['foo', 'bar' => 'qwerty'], $this->instance->get('array'));
+ }
}