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 19, 2021
1 parent ea71359 commit 85eb760
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
20 changes: 5 additions & 15 deletions build/integration/collaboration_features/user_status.feature
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
Feature: user_status
Background:
Given using api version "2"
And user "user0" exists
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 85eb760

Please sign in to comment.