diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-01-14 15:00:41 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-01-14 15:00:41 +0100 |
commit | d195584a324d0b1b2c41e50ad1e545067150aed2 (patch) | |
tree | 0e0827b137d9c86946b90a3f0b6b830f7105316f /tests | |
parent | 8f89e3520d74e1805dc46947742a17683ece6ca7 (diff) | |
download | nextcloud-server-d195584a324d0b1b2c41e50ad1e545067150aed2.tar.gz nextcloud-server-d195584a324d0b1b2c41e50ad1e545067150aed2.zip |
Allow indirect set in CappedMemoryCache
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/cache/cappedmemorycache.php | 12 |
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')); + } } |