function it_adds_a_read_stream($socket, ChannelInterface $channel, ConnectionInterface $connection, LoopInterface $loop) { $channel->getConnection()->willReturn($connection); $connection->getSocket()->willReturn($socket); $loop->addReadStream($socket, [$this, 'wait'])->shouldBeCalled(); $this->beConstructedWith($channel, $loop); }
public function __construct(ChannelInterface $channel, LoopInterface $loop) { $this->channel = $channel; $this->loop = $loop; $this->getLoop()->addReadStream($channel->getConnection()->getSocket(), [$this, 'wait']); }