/** * @test */ public function itShouldWrapARealZMQSocket() { $loop = $this->getMock('React\\EventLoop\\LoopInterface'); $socket = $this->getMockBuilder('ZMQSocket')->disableOriginalConstructor()->getMock(); $socket->expects($this->once())->method('connect')->with('tcp://127.0.0.1:5555'); $wrapped = new SocketWrapper($socket, $loop); $wrapped->connect('tcp://127.0.0.1:5555'); }