diff options
author | Vitor Mattos <vitor@php.rio> | 2022-07-12 08:09:41 -0300 |
---|---|---|
committer | Vitor Mattos <vitor@php.rio> | 2022-07-12 08:13:02 -0300 |
commit | 92093bff12cf3e5812d6702f5182d0c890f4dd31 (patch) | |
tree | 4cd30a7f2d0d463c5cac5b6fb2740e728efe2b73 /tests | |
parent | c7e1b5b807cf9a4bc26291ffee98e18d5947c929 (diff) |
Change point of execution of ExpireChatMessage
Change job from trigged when as necessary to run all times that cron.php
will be executed
Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/features/bootstrap/FeatureContext.php | 26 | ||||
-rw-r--r-- | tests/integration/features/chat/message-expiration.feature | 13 |
2 files changed, 1 insertions, 38 deletions
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index 07c94e047..e7d53ffe7 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -2588,32 +2588,6 @@ class FeatureContext implements Context, SnippetAcceptingContext { sleep($seconds); } - /** - * @When apply message expiration job - */ - public function applyMessageExpirationJob(): void { - $currentUser = $this->currentUser; - $this->setCurrentUser('admin'); - $this->sendRequest('GET', '/apps/spreedcheats/get_message_expiration_job'); - $response = $this->getDataFromResponse($this->response); - Assert::assertIsArray($response, 'Job not found'); - Assert::assertArrayHasKey('id', $response, 'Job not found'); - $this->runOcc(['background-job:execute', $response['id']]); - $this->setCurrentUser($currentUser); - } - - /** - * @When message expiration job don't exists - */ - public function messageExpirationJobDontExists(): void { - $currentUser = $this->currentUser; - $this->setCurrentUser('admin'); - $this->sendRequest('GET', '/apps/spreedcheats/get_message_expiration_job'); - $response = $this->getDataFromResponse($this->response); - Assert::assertEmpty($response, 'Job found'); - $this->setCurrentUser($currentUser); - } - /* * Requests */ diff --git a/tests/integration/features/chat/message-expiration.feature b/tests/integration/features/chat/message-expiration.feature index 2282ded80..00fbbf8c5 100644 --- a/tests/integration/features/chat/message-expiration.feature +++ b/tests/integration/features/chat/message-expiration.feature @@ -19,18 +19,7 @@ Feature: room/message-expiration | id | type | messageExpiration | | room | 3 | 3 | And wait for 3 seconds - And apply message expiration job + And apply message expiration job manually Then user "participant1" sees the following messages in room "room" with 200 | room | actorType | actorId | actorDisplayName | message | messageParameters | parentMessage | | room | users | participant1 | participant1-displayname | Message 1 | [] | | - - - Scenario: Toggle message expiration job - Given user "participant1" creates room "room" (v4) - | roomType | 3 | - | roomName | room | - And user "participant1" adds user "participant2" to room "room" with 200 (v4) - And user "participant1" set the message expiration to 10 of room "room" with 200 (v4) - And apply message expiration job - And user "participant1" set the message expiration to 0 of room "room" with 200 (v4) - Then message expiration job don't exists |