Skip to content

Commit

Permalink
The package will no longer return an array. A Json object will be ret…
Browse files Browse the repository at this point in the history
…urned Api Calls response
  • Loading branch information
ovac committed Mar 24, 2018
1 parent 7bd724a commit 544b933
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Api/Api.php
Expand Up @@ -154,7 +154,7 @@ public function execute($httpMethod, $url, array $parameters = [])
'json' => $parameters,
]);

return json_decode((string) $this->response->getBody(), true);
return json_decode((string) $this->response->getBody());

} catch (ClientException $e) {
throw new Handler($e);
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Api/Transaction/ReceiveMoneyTest.php
Expand Up @@ -412,7 +412,7 @@ public function test_receive_money_end_2_end_successful()

$result = $mock->run();

$this->assertEquals($result, ['X-Foo' => 'Bar']);
$this->assertEquals($result, json_decode(json_encode(['X-Foo' => 'Bar'])));

$request = $container[0]['request'];

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Api/Transaction/RefundTest.php
Expand Up @@ -175,7 +175,7 @@ public function test_send_money_end_2_end_successful()

$result = $mock->run();

$this->assertEquals($result, ['X-Foo' => 'Bar']);
$this->assertEquals($result, json_decode(json_encode(['X-Foo' => 'Bar'])));

$request = $container[0]['request'];

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Api/Transaction/SendMoneyTest.php
Expand Up @@ -377,7 +377,7 @@ public function test_send_money_end_2_end_successful()

$result = $mock->run();

$this->assertEquals($result, ['X-Foo' => 'Bar']);
$this->assertEquals($result, json_decode(json_encode(['X-Foo' => 'Bar'])));

$request = $container[0]['request'];

Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Exception/HandlerTest.php
Expand Up @@ -161,6 +161,8 @@ public function test_4010_missenParameter_request_response()
$this->assertContains('MissingParameter', $e->getErrorType());
$this->assertContains('Some Field', $e->getMissingParameter());
$this->assertContains('Other Field', $e->getMissingParameter());
$this->assertContains('Other Field', $e->getMessage());
$this->assertContains('Some Field', $e->getMessage());

throw $e;
}
Expand Down

0 comments on commit 544b933

Please sign in to comment.