aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-01-14 15:00:41 +0100
committerRobin Appelman <icewind@owncloud.com>2016-01-14 15:00:41 +0100
commitd195584a324d0b1b2c41e50ad1e545067150aed2 (patch)
tree0e0827b137d9c86946b90a3f0b6b830f7105316f /tests
parent8f89e3520d74e1805dc46947742a17683ece6ca7 (diff)
downloadnextcloud-server-d195584a324d0b1b2c41e50ad1e545067150aed2.tar.gz
nextcloud-server-d195584a324d0b1b2c41e50ad1e545067150aed2.zip
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'));
+ }
}