@@ -70,6 +70,30 @@ public function testDoPost_with_encryption_successful() {
7070 $ this ->validateRequest ('POST ' , '/test ' , 'test=true ' , array ('test2 ' => 'value2 ' ), true , array (), true );
7171 }
7272
73+ public function testDoPost_with_encryption_return_response_204_status () {
74+ // Setup data
75+ $ clientPath = __DIR__ . "/../../../resources/private-jwkset1 " ;
76+ $ hyperwalletPath = __DIR__ . "/../../../resources/public-jwkset1 " ;
77+ $ originalMessage = array ('test2 ' => 'value2 ' );
78+ $ encryption = new HyperwalletEncryption ($ clientPath , $ hyperwalletPath );
79+ $ encryptedMessage = $ encryption ->encrypt ($ originalMessage );
80+
81+ // Execute test
82+ $ mockHandler = new MockHandler (array (
83+ new Response (204 )
84+ ));
85+ $ this ->createApiClientWithEncryption ($ mockHandler );
86+
87+ $ model = new BaseModel (array (), $ originalMessage );
88+
89+ // Execute test
90+ $ data = $ this ->apiClient ->doPost ('/test ' , array (), null , array ());
91+ $ this ->assertEquals (array (), $ data );
92+
93+ // Validate api request
94+ $ this ->validateRequest ('POST ' , '/test ' , '' , array (), true , array (), true );
95+ }
96+
7397 public function testDoPost_with_encryption_charset_in_content_type () {
7498 // Setup data
7599 $ clientPath = __DIR__ . "/../../../resources/private-jwkset1 " ;
@@ -292,6 +316,21 @@ public function testDoPost_throw_exception_when_response_has_wrong_content_type_
292316 $ this ->validateRequest ('POST ' , '/test ' , '' , array ('test2 ' => 'value2 ' ), true );
293317 }
294318
319+ public function testDoPost_return_response_204_status () {
320+ // Setup data
321+ $ mockHandler = new MockHandler (array (
322+ new Response (204 )
323+ ));
324+ $ this ->createApiClient ($ mockHandler );
325+
326+ // Execute test
327+ $ data = $ this ->apiClient ->doPost ('/test ' , array (), null , array ());
328+ $ this ->assertEquals (array (), $ data );
329+
330+ // Validate api request
331+ $ this ->validateRequest ('POST ' , '/test ' , '' , array (), true );
332+ }
333+
295334 public function testDoPost_throw_exception_connection_issue () {
296335 // Setup data
297336 $ mockHandler = new MockHandler (array (
@@ -510,6 +549,23 @@ public function testDoPut_return_response_with_path_placeholder() {
510549 $ this ->validateRequest ('PUT ' , '/test/token ' , '' , array ('test2 ' => 'value2 ' ), true );
511550 }
512551
552+ public function testDoPut_return_response_204_status () {
553+ // Setup data
554+ $ mockHandler = new MockHandler (array (
555+ new Response (204 )
556+ ));
557+ $ this ->createApiClient ($ mockHandler );
558+
559+ $ model = new BaseModel (array (), array ());
560+
561+ // Execute test
562+ $ data = $ this ->apiClient ->doPut ('/test ' , array (), $ model , array ());
563+ $ this ->assertEquals (array (), $ data );
564+
565+ // Validate api request
566+ $ this ->validateRequest ('PUT ' , '/test ' , '' , array (), true );
567+ }
568+
513569 public function testDoPut_throw_exception_connection_issue () {
514570 // Setup data
515571 $ mockHandler = new MockHandler (array (
0 commit comments