public function testApiHandleError_CallsMethodOnComponent_WhenHeadersAreReceived()
{
$ex = new Exception();
$conn = $this->getMock(NetworkConnectionInterface::class, [], [], '', false);
$conn->httpHeadersReceived = true;
$aware = $this->createAware();
$component = $this->createComponent();
$component->expects($this->once())->method('handleError')->with($conn, $ex);
$server = $this->createServer($aware, $component);
$server->handleError($conn, $ex);
}