From: Thomas Müller Date: Thu, 31 Oct 2013 09:01:04 +0000 (+0100) Subject: first two tests X-Git-Tag: v5.0.15RC1~2^2~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=86858b408c9e3d886c7b9c42bef241e280cfa63d;p=nextcloud-server.git first two tests --- 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)); + } +}