summaryrefslogtreecommitdiffstats
path: root/tests/lib/cache/cappedmemorycache.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/cache/cappedmemorycache.php')
-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'));
+ }
}