assertInstanceOf(Channel::class, $a); $this->assertInstanceOf(Channel::class, $b); } public function testClose() { list($a, $b) = Channel::create(); // Close $a. $b should close on next read... $a->close(); $b->receive(); Loop\run(); $this->assertFalse($a->isOpen()); $this->assertFalse($b->isOpen()); } public function testSendReceive() { list($a, $b) = Channel::create(); $a->send('hello')->then(function () use ($b) { return $b->receive(); })->done(function ($data) { $this->assertEquals('hello', $data); }); Loop\run(); } }