From: Thomas Müller Date: Thu, 31 Oct 2013 09:01:04 +0000 (+0100) Subject: first two tests X-Git-Tag: v6.0.0beta3~28^2~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7f64d858ddcf62602c40b32ec2325c70a74b8292;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)); + } +}