From 9c2296ef541424e810f876de90467a62d4bc2de8 Mon Sep 17 00:00:00 2001 From: Roger Batista Date: Thu, 26 Jan 2023 11:38:29 +0100 Subject: [PATCH] core: Added fixed response to GakeCgrRpcClient --- .../Domain/Service/Cgrates/FakeCgrRpcClient.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Infrastructure/Domain/Service/Cgrates/FakeCgrRpcClient.php b/Infrastructure/Domain/Service/Cgrates/FakeCgrRpcClient.php index 3ea1f05..284e24e 100644 --- a/Infrastructure/Domain/Service/Cgrates/FakeCgrRpcClient.php +++ b/Infrastructure/Domain/Service/Cgrates/FakeCgrRpcClient.php @@ -10,6 +10,15 @@ class FakeCgrRpcClient implements ClientInterface { + + private $fixedResponse = '{"error": null}'; + + public function __construct( + string $fixedResponse = '{"error": null}' + ) { + $this->fixedResponse = $fixedResponse; + } + public function notification($method, array $params = null) { return $this->createRequest(); @@ -30,7 +39,7 @@ public function send(RequestInterface $request) return new Response( 200, [], - '{"error": null}' + $this->fixedResponse ); }