diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-07-25 21:14:43 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-08-02 10:22:26 +0200 |
commit | a4822f9f9a0a1cad9c9f5ff52cf624f9d6b9df36 (patch) | |
tree | 576b5dced84ad621c5d8005fdc29fd4a00a5d86b /apps/provisioning_api/tests | |
parent | 97d79202ac628b004f5d9e167b5b8c9a36da9906 (diff) | |
download | nextcloud-server-a4822f9f9a0a1cad9c9f5ff52cf624f9d6b9df36.tar.gz nextcloud-server-a4822f9f9a0a1cad9c9f5ff52cf624f9d6b9df36.zip |
[provisioning_api] Move part of apps to OCP
Diffstat (limited to 'apps/provisioning_api/tests')
-rw-r--r-- | apps/provisioning_api/tests/appstest.php | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/apps/provisioning_api/tests/appstest.php b/apps/provisioning_api/tests/appstest.php index c4298f017fc..2a623098444 100644 --- a/apps/provisioning_api/tests/appstest.php +++ b/apps/provisioning_api/tests/appstest.php @@ -25,8 +25,15 @@ namespace OCA\Provisioning_API\Tests; class AppsTest extends TestCase { + + public function setup() { + parent::setup(); + $this->appManager = \OC::$server->getAppManager(); + $this->api = new \OCA\Provisioning_API\Apps($this->appManager); + } + public function testGetAppInfo() { - $result = \OCA\provisioning_API\Apps::getAppInfo(array('appid' => 'provisioning_api')); + $result = $this->api->getAppInfo(['appid' => 'provisioning_api']); $this->assertInstanceOf('OC_OCS_Result', $result); $this->assertTrue($result->succeeded()); @@ -34,7 +41,7 @@ class AppsTest extends TestCase { public function testGetAppInfoOnBadAppID() { - $result = \OCA\provisioning_API\Apps::getAppInfo(array('appid' => 'not_provisioning_api')); + $result = $this->api->getAppInfo(['appid' => 'not_provisioning_api']); $this->assertInstanceOf('OC_OCS_Result', $result); $this->assertFalse($result->succeeded()); $this->assertEquals(\OCP\API::RESPOND_NOT_FOUND, $result->getStatusCode()); @@ -47,7 +54,7 @@ class AppsTest extends TestCase { \OC_Group::addToGroup($user, 'admin'); self::loginAsUser($user); - $result = \OCA\provisioning_API\Apps::getApps(array()); + $result = $this->api->getApps([]); $this->assertTrue($result->succeeded()); $data = $result->getData(); @@ -58,7 +65,7 @@ class AppsTest extends TestCase { public function testGetAppsEnabled() { $_GET['filter'] = 'enabled'; - $result = \OCA\provisioning_API\Apps::getApps(array('filter' => 'enabled')); + $result = $this->api->getApps(['filter' => 'enabled']); $this->assertTrue($result->succeeded()); $data = $result->getData(); $this->assertEquals(count(\OC_App::getEnabledApps()), count($data['apps'])); @@ -68,7 +75,7 @@ class AppsTest extends TestCase { public function testGetAppsDisabled() { $_GET['filter'] = 'disabled'; - $result = \OCA\provisioning_API\Apps::getApps(array('filter' => 'disabled')); + $result = $this->api->getApps(['filter' => 'disabled']); $this->assertTrue($result->succeeded()); $data = $result->getData(); $apps = \OC_App::listAllApps(); |