Skip to content
Next Next commit
Make possible to verify a subset of the room properties
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen authored and danxuliu committed Dec 18, 2020
commit fefefc0a1b77eba82af44b86a7b6311320990fcc
30 changes: 24 additions & 6 deletions tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,30 @@ public function userIsParticipantOfRooms($user, TableNode $formData = null) {
$participantNames[$lastParticipantKey] .= ' [exact order]';
}

return [
'id' => self::$tokenToIdentifier[$room['token']],
'type' => (string) $room['type'],
'participantType' => (string) $room['participantType'],
'participants' => implode(', ', $participantNames),
];
$data = [];
if (isset($expectedRoom['id'])) {
$data['id'] = self::$tokenToIdentifier[$room['token']];
}
if (isset($expectedRoom['name'])) {
$data['name'] = $room['name'];
}
if (isset($expectedRoom['type'])) {
$data['type'] = (string) $room['type'];
}
if (isset($expectedRoom['hasPassword'])) {
$data['hasPassword'] = (string) $room['hasPassword'];
}
if (isset($expectedRoom['readOnly'])) {
$data['readOnly'] = (string) $room['readOnly'];
}
if (isset($expectedRoom['participantType'])) {
$data['participantType'] = (string) $room['participantType'];
}
if (isset($expectedRoom['participants'])) {
$data['participants'] = implode(', ', $participantNames);
}

return $data;
}, $rooms, $formData->getHash()));
}

Expand Down