From 5baca432a8c9d2523e2ed1b21f3a625b61ac8f12 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 24 Mar 2021 17:27:59 +0100 Subject: [PATCH] fix tests --- tests/e2e/Services/Realtime/RealtimeBase.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tests/e2e/Services/Realtime/RealtimeBase.php b/tests/e2e/Services/Realtime/RealtimeBase.php index fece44b18c..8b9a464324 100644 --- a/tests/e2e/Services/Realtime/RealtimeBase.php +++ b/tests/e2e/Services/Realtime/RealtimeBase.php @@ -666,6 +666,7 @@ trait RealtimeBase $this->assertNotEmpty($execution['body']['$id']); $response = json_decode($client->receive(), true); + $responseUpdate = json_decode($client->receive(), true); $this->assertArrayHasKey('timestamp', $response); $this->assertCount(3, $response['channels']); @@ -675,15 +676,13 @@ trait RealtimeBase $this->assertEquals('functions.executions.create', $response['event']); $this->assertNotEmpty($response['payload']); - $response = json_decode($client->receive(), true); - - $this->assertArrayHasKey('timestamp', $response); - $this->assertCount(3, $response['channels']); - $this->assertContains('executions', $response['channels']); - $this->assertContains('executions.' . $execution['body']['$id'], $response['channels']); - $this->assertContains('functions.' . $execution['body']['functionId'], $response['channels']); - $this->assertEquals('functions.executions.update', $response['event']); - $this->assertNotEmpty($response['payload']); + $this->assertArrayHasKey('timestamp', $responseUpdate); + $this->assertCount(3, $responseUpdate['channels']); + $this->assertContains('executions', $responseUpdate['channels']); + $this->assertContains('executions.' . $execution['body']['$id'], $responseUpdate['channels']); + $this->assertContains('functions.' . $execution['body']['functionId'], $responseUpdate['channels']); + $this->assertEquals('functions.executions.update', $responseUpdate['event']); + $this->assertNotEmpty($responseUpdate['payload']); $client->close(); }