Skip to content

Commit ce7d1d1

Browse files
authored
Merge pull request #33123 from owncloud/stable10-occTest-cliProvisioning-getGroups
[stable10] occ test cli provisioning get groups
2 parents a31afd3 + deba560 commit ce7d1d1

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

tests/acceptance/features/bootstrap/OccContext.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,17 @@ public function theAdministratorGetsTheUsersInTheGroupUsingTheOccCommand($groupN
255255
);
256256
}
257257

258+
/**
259+
* @When the administrator gets the groups using the occ command
260+
*
261+
* @return void
262+
*/
263+
public function theAdministratorGetsTheGroupsUsingTheOccCommand() {
264+
$this->featureContext->invokingTheCommand(
265+
"group:list --output=json"
266+
);
267+
}
268+
258269
/**
259270
* @When the administrator disables the app :appName using the occ command
260271
*
@@ -394,6 +405,22 @@ public function theUsersReturnedByTheOccCommandShouldBe(TableNode $useridTable)
394405
}
395406
}
396407

408+
/**
409+
* @Then the groups returned by the occ command should be
410+
*
411+
* @param TableNode $groupTableNode with group name with header group
412+
*
413+
* @return void
414+
*/
415+
public function theGroupsReturnedByTheOccCommandShouldBe(TableNode $groupTableNode) {
416+
$lastOutput = $this->featureContext->getStdOutOfOccCommand();
417+
$lastOutputGroups = \json_decode($lastOutput, true);
418+
419+
foreach ($groupTableNode as $row) {
420+
PHPUnit_Framework_Assert::assertContains($row['group'], $lastOutputGroups);
421+
}
422+
}
423+
397424
/**
398425
* This will run before EVERY scenario.
399426
* It will set the properties for this object.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@cli @skipOnLDAP
2+
Feature: get groups
3+
As an admin
4+
I want to be able to get groups
5+
So that I can see all the groups in my ownCloud
6+
7+
Scenario: admin gets all the groups
8+
Given group "0" has been created
9+
And group "new-group" has been created
10+
And group "España" has been created
11+
When the administrator gets the groups using the occ command
12+
Then the command should have been successful
13+
And the groups returned by the occ command should be
14+
| group |
15+
| España |
16+
| admin |
17+
| new-group |
18+
| 0 |

0 commit comments

Comments
 (0)