Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
  • Loading branch information
LukasReschke authored and MorrisJobke committed May 20, 2017
1 parent 4bf9df9 commit 551a189
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
12 changes: 8 additions & 4 deletions tests/lib/App/AppManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function testNotEnableIfNotInstalled() {
$this->assertEquals('no', $this->appConfig->getValue(
'some_random_name_which_i_hope_is_not_an_app', 'enabled', 'no'
));
}
}

public function testEnableAppForGroups() {
$groups = array(
Expand Down Expand Up @@ -333,6 +333,7 @@ public function testGetInstalledApps() {
'federatedfilesharing',
'files',
'lookup_server_connector',
'oauth2',
'provisioning_api',
'test1',
'test3',
Expand All @@ -358,11 +359,12 @@ public function testGetAppsForUser() {
'federatedfilesharing',
'files',
'lookup_server_connector',
'oauth2',
'provisioning_api',
'test1',
'test3',
'twofactor_backupcodes',
'workflowengine'
'workflowengine',
];
$this->assertEquals($enabled, $this->manager->getEnabledAppsForUser($user));
}
Expand All @@ -387,6 +389,7 @@ public function testGetAppsNeedingUpgrade() {
'testnoversion' => ['id' => 'testnoversion', 'requiremin' => '8.2.0'],
'twofactor_backupcodes' => ['id' => 'twofactor_backupcodes'],
'workflowengine' => ['id' => 'workflowengine'],
'oauth2' => ['id' => 'oauth2'],
];

$manager->expects($this->any())
Expand All @@ -395,7 +398,7 @@ public function testGetAppsNeedingUpgrade() {
function($appId) use ($appInfos) {
return $appInfos[$appId];
}
));
));

$this->appConfig->setValue('test1', 'enabled', 'yes');
$this->appConfig->setValue('test1', 'installed_version', '1.0.0');
Expand Down Expand Up @@ -432,6 +435,7 @@ public function testGetIncompatibleApps() {
'testnoversion' => ['id' => 'testnoversion', 'requiremin' => '8.2.0'],
'twofactor_backupcodes' => ['id' => 'twofactor_backupcodes'],
'workflowengine' => ['id' => 'workflowengine'],
'oauth2' => ['id' => 'oauth2'],
];

$manager->expects($this->any())
Expand All @@ -440,7 +444,7 @@ public function testGetIncompatibleApps() {
function($appId) use ($appInfos) {
return $appInfos[$appId];
}
));
));

$this->appConfig->setValue('test1', 'enabled', 'yes');
$this->appConfig->setValue('test2', 'enabled', 'yes');
Expand Down
9 changes: 7 additions & 2 deletions tests/lib/AppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ public function appConfigValuesProvider() {
'dav',
'federatedfilesharing',
'lookup_server_connector',
'oauth2',
'provisioning_api',
'twofactor_backupcodes',
'workflowengine',
Expand All @@ -371,6 +372,7 @@ public function appConfigValuesProvider() {
'dav',
'federatedfilesharing',
'lookup_server_connector',
'oauth2',
'provisioning_api',
'twofactor_backupcodes',
'workflowengine',
Expand All @@ -390,6 +392,7 @@ public function appConfigValuesProvider() {
'dav',
'federatedfilesharing',
'lookup_server_connector',
'oauth2',
'provisioning_api',
'twofactor_backupcodes',
'workflowengine',
Expand All @@ -409,6 +412,7 @@ public function appConfigValuesProvider() {
'dav',
'federatedfilesharing',
'lookup_server_connector',
'oauth2',
'provisioning_api',
'twofactor_backupcodes',
'workflowengine',
Expand All @@ -428,6 +432,7 @@ public function appConfigValuesProvider() {
'dav',
'federatedfilesharing',
'lookup_server_connector',
'oauth2',
'provisioning_api',
'twofactor_backupcodes',
'workflowengine',
Expand Down Expand Up @@ -508,11 +513,11 @@ public function testEnabledAppsCache() {
);

$apps = \OC_App::getEnabledApps();
$this->assertEquals(array('files', 'app3', 'dav', 'federatedfilesharing', 'lookup_server_connector', 'provisioning_api', 'twofactor_backupcodes', 'workflowengine'), $apps);
$this->assertEquals(array('files', 'app3', 'dav', 'federatedfilesharing', 'lookup_server_connector', 'oauth2', 'provisioning_api', 'twofactor_backupcodes', 'workflowengine'), $apps);

// mock should not be called again here
$apps = \OC_App::getEnabledApps();
$this->assertEquals(array('files', 'app3', 'dav', 'federatedfilesharing', 'lookup_server_connector', 'provisioning_api', 'twofactor_backupcodes', 'workflowengine'), $apps);
$this->assertEquals(array('files', 'app3', 'dav', 'federatedfilesharing', 'lookup_server_connector', 'oauth2', 'provisioning_api', 'twofactor_backupcodes', 'workflowengine'), $apps);

$this->restoreAppConfig();
\OC_User::setUserId(null);
Expand Down

0 comments on commit 551a189

Please sign in to comment.