diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-15 12:37:36 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-15 12:37:36 +0100 |
commit | b37634a57de1f6a814687670b32472895ed49314 (patch) | |
tree | 08812523f661355a1da23de4cfac4f3e0b59a476 /tests | |
parent | d8867f7692aae2cc5bb2ffaf00c53c9e77c61faf (diff) | |
parent | d195584a324d0b1b2c41e50ad1e545067150aed2 (diff) | |
download | nextcloud-server-b37634a57de1f6a814687670b32472895ed49314.tar.gz nextcloud-server-b37634a57de1f6a814687670b32472895ed49314.zip |
Merge pull request #21721 from owncloud/capped-memcache-indirect-set
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')); + } } |