diff --git a/build/integration/collaboration_features/user_status.feature b/build/integration/collaboration_features/user_status.feature index cfb2583a2a7e8..ffc4676b860cf 100644 --- a/build/integration/collaboration_features/user_status.feature +++ b/build/integration/collaboration_features/user_status.feature @@ -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" diff --git a/build/integration/features/bootstrap/CollaborationContext.php b/build/integration/features/bootstrap/CollaborationContext.php index 856f07c76a4b1..d95bc8ffc923a 100644 --- a/build/integration/features/bootstrap/CollaborationContext.php +++ b/build/integration/features/bootstrap/CollaborationContext.php @@ -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]); } /**