summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Kindströmmer <hannes@kindstrommer.se>2017-03-21 13:32:43 +0100
committerHannes Kindströmmer <hannes@kindstrommer.se>2017-03-21 13:32:43 +0100
commitaf5266b74282cfca64cb89003cbdd1fb2792743f (patch)
treeaae2f68a41b39856b83802b17ea06757f293c43e
parent92fe5b5decf7f84634a7b91e2589d255965a6daa (diff)
downloadip1-php-sdk-af5266b74282cfca64cb89003cbdd1fb2792743f.zip
ip1-php-sdk-af5266b74282cfca64cb89003cbdd1fb2792743f.tar.gz
ip1-php-sdk-af5266b74282cfca64cb89003cbdd1fb2792743f.tar.bz2
Debugging edits
Signed-off-by: Hannes Kindströmmer <hannes@kindstrommer.se>
-rw-r--r--src/Core/Communicator.php5
-rw-r--r--tests/Recipient/MembershipTest.php1
2 files changed, 4 insertions, 2 deletions
diff --git a/src/Core/Communicator.php b/src/Core/Communicator.php
index 9ab6b13..81b0331 100644
--- a/src/Core/Communicator.php
+++ b/src/Core/Communicator.php
@@ -16,6 +16,7 @@ use IP1\RESTClient\Recipient\ProcessedBlacklistEntry;
use IP1\RESTClient\Core\ProcessedComponentInterface;
use IP1\RESTClient\Core\UpdatableComponentInterface;
use IP1\RESTClient\Core\ProcessableComponentInterface;
+use \Httpful\Response;
/**
* Handles request to the API and converts the responses into the data classes.
@@ -212,7 +213,7 @@ class Communicator
* @param boolean $https Whether the the API call should use HTTPS or not(HTTP).
* @return string The response from the API.
*/
- private function sendRequest(string $endPoint, string $method, string $content = "", bool $https = false): string
+ private function sendRequest(string $endPoint, string $method, string $content = "", bool $https = false): Response
{
$url = ($https ? "https://" : "http://") . self::DOMAIN . "/" .$endPoint;
$request = \Httpful\Request::init($method, 'application/json');
@@ -228,6 +229,6 @@ class Communicator
if ($response->hasErrors()) {
$this->errorResponses[] = $response;
}
- return $response->__toString();
+ return $response;
}
}
diff --git a/tests/Recipient/MembershipTest.php b/tests/Recipient/MembershipTest.php
index b2aa654..cf57895 100644
--- a/tests/Recipient/MembershipTest.php
+++ b/tests/Recipient/MembershipTest.php
@@ -42,6 +42,7 @@ class MembershipTest extends AbstractEnviromentProvider
$groups[] = $this->getCommunicator()->add($g);
$m = new Membership($groups[$i]->getID(), $contacts[$i]->getID());
$memberships[] = $this->getCommunicator()->add($m);
+ var_dump($this->getCommunicator()->errorResponses);
}
$this->assertEquals(10, count($contacts));
$this->assertEquals(10, count($groups));