Closed choval closed 6 years ago
Test fails because it expects the message to be at index '2', but the response array is reset and should expect the response to be at '0' .
From: `
$responses = $instance->receive();
$this->assertTrue(is_array($responses));
$this->assertCount(1, $responses);
$this->assertInstanceOf(Payload::class, $responses[2]);
`
Should be: `
$responses = $instance->receive();
$this->assertTrue(is_array($responses));
$this->assertCount(1, $responses);
$this->assertInstanceOf(Payload::class, $responses[0]);
`
/lib/Client.php onData just keeps pushing payloads to the received array without ever cleaning it.
If the Wrench client is run in a loop, the array just keeps growing. I don't see any reason to keep the previous received messages and calculating the diff on each receive() call.