From 7f64d858ddcf62602c40b32ec2325c70a74b8292 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20M=C3=BCller?= Date: Thu, 31 Oct 2013 10:01:04 +0100 Subject: [PATCH] first two tests --- tests/lib/ocs/privatedata.php | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 tests/lib/ocs/privatedata.php diff --git a/tests/lib/ocs/privatedata.php b/tests/lib/ocs/privatedata.php new file mode 100644 index 00000000000..03129e4d0d0 --- /dev/null +++ b/tests/lib/ocs/privatedata.php @@ -0,0 +1,53 @@ +. + * + */ + +class Test_OC_OCS_Privatedata extends PHPUnit_Framework_TestCase +{ + + private $appKey; + + public function setUp() { + \OC::$session->set('user_id', 'user1'); + $this->appKey = uniqid('app'); + } + + public function tearDown() { + } + + public function testGetEmptyOne() { + $params = array('app' => $this->appKey, 'key' => '123'); + $result = OC_OCS_Privatedata::get($params); + $this->assertEquals(100, $result->getStatusCode()); + $data = $result->getData(); + $this->assertTrue(is_array($data)); + $this->assertEquals(0, sizeof($data)); + } + + public function testGetEmptyAll() { + $params = array('app' => $this->appKey); + $result = OC_OCS_Privatedata::get($params); + $this->assertEquals(100, $result->getStatusCode()); + $data = $result->getData(); + $this->assertTrue(is_array($data)); + $this->assertEquals(0, sizeof($data)); + } +} -- 2.39.5