Пример #1
0
 public function testGetAppsInvalidFilter()
 {
     $_GET['filter'] = 'foo';
     $result = $this->api->getApps([]);
     $this->assertFalse($result->succeeded());
     $this->assertEquals(101, $result->getStatusCode());
 }
Пример #2
0
 public function testGetAppsDisabled()
 {
     $_GET['filter'] = 'disabled';
     $result = \OCA\provisioning_API\Apps::getApps(array('filter' => 'disabled'));
     $this->assertTrue($result->succeeded());
     $data = $result->getData();
     $apps = \OC_App::listAllApps();
     $list = array();
     foreach ($apps as $app) {
         $list[] = $app['id'];
     }
     $disabled = array_diff($list, \OC_App::getEnabledApps());
     $this->assertEquals(count($disabled), count($data['apps']));
 }