end($message); $received = ""; while (null !== $chunk = yield $b->read()) { $received .= $chunk; } $this->assertSame($message, $received); }); } }