Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Meurer <jonas@freesources.org>
  • Loading branch information
mejo- committed Oct 20, 2021
1 parent ea71359 commit 6e30710
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
19 changes: 5 additions & 14 deletions build/integration/collaboration_features/user_status.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,16 @@ Feature: user_status
And user "user0" has status "dnd"

Scenario: listing recent user statuses with default settings
When user "user0" has status "dnd"
Then user statuses for "admin" list "user0" with status "dnd"

Scenario: empty recent user statuses with disabled user enumeration
Given As an "admin"
Scenario: empty recent user statuses with disabled/limited user enumeration
When parameter "shareapi_allow_share_dialog_user_enumeration" of app "core" is set to "no"
And user "user0" has status "dnd"
Then user statuses for "admin" are empty

Scenario: empty recent user statuses with user enumeration limited to common groups
Given As an "admin"
When parameter "shareapi_allow_share_dialog_user_enumeration" of app "core" is set to "yes"
And parameter "shareapi_restrict_user_enumeration_to_group" of app "core" is set to "yes"
And user "user0" has status "dnd"
When parameter "shareapi_restrict_user_enumeration_to_group" of app "core" is set to "yes"
Then user statuses for "admin" are empty

Scenario: empty recent user statuses with user enumeration limited to phone matches
Given As an "admin"
When parameter "shareapi_restrict_user_enumeration_to_group" of app "core" is set to "no"
And parameter "shareapi_restrict_user_enumeration_to_phone" of app "core" is set to "yes"
And user "user0" has status "dnd"
When parameter "shareapi_restrict_user_enumeration_to_phone" of app "core" is set to "yes"
Then user statuses for "admin" are empty
When parameter "shareapi_restrict_user_enumeration_to_phone" of app "core" is set to "no"
Then user statuses for "admin" list "user0" with status "dnd"
8 changes: 6 additions & 2 deletions build/integration/features/bootstrap/CollaborationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,12 @@ public function getStatusList(string $user): ?array {
*/
public function assertStatusesList(string $user, string $statusUser, string $status): void {
$statusList = $this->getStatusList($user);
Assert::assertArrayHasKey('element', $statusList);
Assert::assertEquals($status, array_column($statusList['element'], 'status', 'userId')[$statusUser]);
var_dump($statusList);
Assert::assertArrayHasKey('element', $statusList, 'Returned status list empty or broken');
$filteredStatusList = array_column($statusList['element'], 'status', 'userId');
var_dump($filteredStatusList);
Assert::assertArrayHasKey($statusUser, $filteredStatusList, 'User not listed in statuses: ' . $statusUser);
Assert::assertEquals($status, $filteredStatusList[$statusUser]);
}

/**
Expand Down

0 comments on commit 6e30710

Please sign in to comment.