File tree Expand file tree Collapse file tree 3 files changed +55
-0
lines changed
tests/acceptance/features Expand file tree Collapse file tree 3 files changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -467,6 +467,16 @@ public function theCommandErrorOutputContainsTheText($text) {
467467 );
468468 }
469469
470+ /**
471+ * @Then the occ command JSON output should be empty
472+ *
473+ * @return void
474+ */
475+ public function theOccCommandJsonOutputShouldNotReturnAnyData () {
476+ PHPUnit_Framework_Assert::assertEquals (\trim ($ this ->lastStdOut ), "[] " );
477+ PHPUnit_Framework_Assert::assertEmpty ($ this ->lastStdErr );
478+ }
479+
470480 private $ lastTransferPath ;
471481
472482 /**
Original file line number Diff line number Diff line change @@ -201,6 +201,19 @@ public function theAdministratorSendsAUserDeletionRequestForUserUsingTheOccComma
201201 );
202202 }
203203
204+ /**
205+ * @When the administrator retrieves the information of user :username using the occ command
206+ *
207+ * @param string $username
208+ *
209+ * @return void
210+ */
211+ public function theAdministratorRetrievesTheInformationOfUserUsingTheOccCommand ($ username ) {
212+ $ this ->featureContext ->invokingTheCommand (
213+ "user:list $ username --output=json "
214+ );
215+ }
216+
204217 /**
205218 * @When the administrator sends a group creation request for group :group using the occ command
206219 *
@@ -421,6 +434,20 @@ public function theGroupsReturnedByTheOccCommandShouldBe(TableNode $groupTableNo
421434 }
422435 }
423436
437+ /**
438+ * @Then the display name returned by the occ command should be :displayName
439+ *
440+ * @param string $displayName
441+ *
442+ * @return void
443+ */
444+ public function theDisplayNameReturnedByTheOccCommandShouldBe ($ displayName ) {
445+ $ lastOutput = $ this ->featureContext ->getStdOutOfOccCommand ();
446+ $ lastOutputUser = \json_decode ($ lastOutput , true );
447+ $ lastOutputDisplayName = \array_column ($ lastOutputUser , 'displayName ' )[0 ];
448+ PHPUnit_Framework_Assert::assertEquals ($ displayName , $ lastOutputDisplayName );
449+ }
450+
424451 /**
425452 * This will run before EVERY scenario.
426453 * It will set the properties for this object.
Original file line number Diff line number Diff line change 1+ @cli @skipOnLDAP
2+ Feature : get user
3+ As an admin, subadmin or as myself
4+ I want to be able to retrieve user information
5+ So that I can see the information
6+
7+ Scenario : admin gets an existing user
8+ Given user "brand-new-user" has been created
9+ And user "%admin%" has changed the display name of user "brand-new-user" to "Anne Brown"
10+ When the administrator retrieves the information of user "brand-new-user" using the occ command
11+ Then the command should have been successful
12+ And the display name returned by the occ command should be "Anne Brown"
13+
14+ Scenario : admin tries to get a not existing user
15+ Given user "not-a-user" has been deleted
16+ When the administrator retrieves the information of user "not-a-user" using the occ command
17+ Then the command should have been successful
18+ And the occ command JSON output should be empty
You can’t perform that action at this time.
0 commit comments