public function testConnect_usesHostAndPort() { $host = 'testHost'; $port = 6696; $this->_socketCreateSuccess(); $this->_getNativeFunctionMock()->expects($this->once())->method('socket_connect')->with($this->anything(), $host, $port)->willReturn(true); $socket = new Socket($host, $port); $socket->connect(); $this->assertTrue($socket->isConnected()); }