Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occ test cli provisioning get apps #33116

Merged
merged 1 commit into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions tests/acceptance/features/bootstrap/OccContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,17 @@ public function administratorGetsTheAppInfoOfTheApp($appName) {
);
}

/**
* @When the administrator gets the list of apps using the occ command
*
* @return void
*/
public function theAdministratorGetsTheListOfAppsUsingTheOccCommand() {
$this->featureContext->invokingTheCommand(
"config:list"
);
}

/**
* @When the administrator disables the user :username using the occ command
*
Expand Down Expand Up @@ -335,6 +346,25 @@ public function theAppEnabledStatusShouldBe($appName, $appStatus) {
PHPUnit_Framework_Assert::assertEquals($appStatus, $actualAppEnabledStatus);
}

/**
* @Then the apps returned by the occ command should include
*
* @param TableNode $appListTable table with apps name with no header
*
* @return void
*/
public function theAppsReturnedByTheOccCommandShouldInclude(TableNode $appListTable) {
$lastOutput = $this->featureContext->getStdOutOfOccCommand();
$lastOutputApps = \array_keys(\json_decode($lastOutput, true)['apps']);

$apps = $appListTable->getRows();
$appsSimplified = $this->featureContext->simplifyArray($apps);

foreach ($appsSimplified as $app) {
PHPUnit_Framework_Assert::assertContains($app, $lastOutputApps);
}
}

/**
* This will run before EVERY scenario.
* It will set the properties for this object.
Expand Down
22 changes: 22 additions & 0 deletions tests/acceptance/features/cliProvisioning/getApps.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@cli @skipOnLDAP
Feature: get apps
As an admin
I want to be able to get the list of apps on my ownCloud
So that I can manage apps

Scenario: admin gets enabled apps
When the administrator gets the list of apps using the occ command
Then the command should have been successful
And the apps returned by the occ command should include
| comments |
| dav |
| federatedfilesharing |
| federation |
| files |
| files_sharing |
| files_trashbin |
| files_versions |
| provisioning_api |
| systemtags |
| updatenotification |
| files_external |