diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-05-02 13:21:31 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2014-07-17 13:18:49 +0200 |
commit | 8231f1ef8c481449871de71ed5f6b229bba414b8 (patch) | |
tree | 6ebfa1235e28a081d0337c365b10233b235b8735 /tests/lib/ocs | |
parent | d8bd8c4b6693792024ac1b740b7bc38ae46387d8 (diff) | |
download | nextcloud-server-8231f1ef8c481449871de71ed5f6b229bba414b8.tar.gz nextcloud-server-8231f1ef8c481449871de71ed5f6b229bba414b8.zip |
Added test of OCS privatedata to trigger key duplication
Diffstat (limited to 'tests/lib/ocs')
-rw-r--r-- | tests/lib/ocs/privatedata.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/lib/ocs/privatedata.php b/tests/lib/ocs/privatedata.php index 498ab718621..530750fabea 100644 --- a/tests/lib/ocs/privatedata.php +++ b/tests/lib/ocs/privatedata.php @@ -79,6 +79,31 @@ class Test_OC_OCS_Privatedata extends PHPUnit_Framework_TestCase $this->assertEquals('updated', $data['value']); } + public function testSetSameValue() { + $_POST = array('value' => 123456789); + $params = array('app' => $this->appKey, 'key' => 'k-10'); + $result = OC_OCS_Privatedata::set($params); + $this->assertEquals(100, $result->getStatusCode()); + + $result = OC_OCS_Privatedata::get($params); + $this->assertOcsResult(1, $result); + $data = $result->getData(); + $data = $data[0]; + $this->assertEquals('123456789', $data['value']); + + // set the same value again + $_POST = array('value' => 123456789); + $params = array('app' => $this->appKey, 'key' => 'k-10'); + $result = OC_OCS_Privatedata::set($params); + $this->assertEquals(100, $result->getStatusCode()); + + $result = OC_OCS_Privatedata::get($params); + $this->assertOcsResult(1, $result); + $data = $result->getData(); + $data = $data[0]; + $this->assertEquals('123456789', $data['value']); + } + public function testSetMany() { $_POST = array('value' => 123456789); |