summaryrefslogtreecommitdiffstats
path: root/tests/integration/features/bootstrap/FeatureContext.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/features/bootstrap/FeatureContext.php')
-rw-r--r--tests/integration/features/bootstrap/FeatureContext.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php
index f4aa7d3c1..fba2898fc 100644
--- a/tests/integration/features/bootstrap/FeatureContext.php
+++ b/tests/integration/features/bootstrap/FeatureContext.php
@@ -2020,7 +2020,7 @@ class FeatureContext implements Context, SnippetAcceptingContext {
* @param string $statusCode
* @param string $apiVersion
*/
- public function userEditsMessageToRoom(string $user, string $oldMessage, string $identifier, string $newMessage, string $statusCode, string $apiVersion = 'v1') {
+ public function userEditsMessageToRoom(string $user, string $oldMessage, string $identifier, string $newMessage, int $statusCode, string $apiVersion = 'v1', ?TableNode $formData = null) {
$oldMessage = substr($oldMessage, 1, -1);
$oldMessage = str_replace('\n', "\n", $oldMessage);
$messageId = self::$textToMessageId[$oldMessage];
@@ -2036,8 +2036,15 @@ class FeatureContext implements Context, SnippetAcceptingContext {
$this->assertStatusCode($this->response, $statusCode);
sleep(1); // make sure Postgres manages the order of the messages
- self::$textToMessageId[$newMessage] = $messageId;
- self::$messageIdToText[$messageId] = $newMessage;
+ if ($statusCode === 200 || $statusCode === 202) {
+ self::$textToMessageId[$newMessage] = $messageId;
+ self::$messageIdToText[$messageId] = $newMessage;
+ } elseif ($formData instanceof TableNode) {
+ Assert::assertEquals(
+ $formData->getRowsHash(),
+ $this->getDataFromResponse($this->response),
+ );
+ }
}
/**
@@ -3893,6 +3900,14 @@ class FeatureContext implements Context, SnippetAcceptingContext {
}
/**
+ * @Given /^aging messages (\d+) hours in room "([^"]*)"$/
+ */
+ public function occAgeChatMessages(int $hours, string $identifier): void {
+ $this->runOcc(['talk:developer:age-chat-messages', '--hours', $hours, self::$identifierToToken[$identifier]]);
+ $this->theCommandWasSuccessful();
+ }
+
+ /**
* @Given /^the following recording consent is recorded for (room|user) "([^"]*)"$/
*/
public function occRecordingConsentLists(string $filterType, string $identifier, TableNode $tableNode): void {