/** * Exits the test before its end */ public function exitTest() { $code = 200; try { $serviceContext = $this->getServiceContext(); $response = ['success' => $this->runnerService->exitTest($serviceContext)]; $this->runnerService->persist($serviceContext); } catch (common_Exception $e) { $response = $this->getErrorResponse($e); $code = $this->getErrorCode($e); } $this->returnJson($response, $code); }