"TEST-BRE-001", "age" => 35, "loan_amount" => 500000, "tenure" => 24, "interest_rate" => 15.0, "gender" => "male", "residence_area" => "urban", "applicant_ntc" => "no" ]; } public function custom(array $params): array { try { // Instantiate the controller with an empty request $request = new Request(); $controller = new BlacksoilController($request); // Use Reflection to access the private callDecisionApi method $reflection = new ReflectionClass($controller); $method = $reflection->getMethod('callDecisionApi'); $method->setAccessible(true); // Invoke the private API method directly with the payload // Returns: list($apiOk, $httpStatus, $apiResponse, $errorMsg) $result = $method->invoke($controller, $params); return [ 'status' => 'success', 'api_ok' => $result[0], 'http_status' => $result[1], 'response' => $result[2], 'error_msg' => $result[3] ]; } catch (\Exception $e) { return [ 'status' => 'error', 'message' => $e->getMessage(), 'trace' => $e->getTraceAsString() ]; } } protected function cases(array $params = []): array { // Provide a dummy test case to satisfy the run() method if called via GET return [ [ 'suite' => 'BRE API Isolation Test', 'description' => 'Test decision API using sample payload', 'payload' => $this->sampleInput(), 'expected' => true, 'assertType' => 'equals', ] ]; } protected function execute(array $case) { $result = $this->custom($case['payload']); return $result['api_ok'] ?? false; } }