Skip to content

Commit

Permalink
Correctly set the index of the messages in the array when a sytem mes…
Browse files Browse the repository at this point in the history
…sage was killed

Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Mar 22, 2019
1 parent 44be137 commit 27ecdd0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,14 @@ public function userSeesTheFollowingMessagesInRoom($user, $identifier, $statusCo
$this->sendRequest('GET', '/apps/spreed/api/v1/chat/' . self::$identifierToToken[$identifier] . '?lookIntoFuture=0');
$this->assertStatusCode($this->response, $statusCode);

$messages = $this->getDataFromResponse($this->response);
$messages = array_filter($messages, function(array $message) {
$actual = $this->getDataFromResponse($this->response);
$messages = [];
array_map(function(array $message) use (&$messages) {
// Filter out system messages
return $message['systemMessage'] === '';
});
if ($message['systemMessage'] === '') {
$messages[] = $message;
}
}, $actual);

if ($formData === null) {
PHPUnit_Framework_Assert::assertEmpty($messages);
Expand Down

0 comments on commit 27ecdd0

Please sign in to comment.