public function testApiHandleError_CallsMethodOnComponent()
{
$listener = $this->createListener();
$component = $this->createComponent();
$component->expects($this->once())->method('handleError')->with($this->isInstanceOf(NetworkConnection::class), $this->isInstanceOf(Exception::class));
$socket = $this->getMock(SocketInterface::class, [], [], '', false);
$socket->conn = new NetworkConnection($socket);
$server = $this->createSocketServer($listener, $component);
$server->handleError($socket, new Exception());
}