@@ -68,6 +68,9 @@ discard block |
||
| 68 | 68 | return $this->getMock('\JMS\Serializer\SerializerInterface'); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | + /** |
|
| 72 | + * @param string $data |
|
| 73 | + */ |
|
| 71 | 74 | protected function validateDeserializer($data, $type, $returnValue) |
| 72 | 75 | { |
| 73 | 76 | $this->serializer |
@@ -124,6 +127,9 @@ discard block |
||
| 124 | 127 | return $response; |
| 125 | 128 | } |
| 126 | 129 | |
| 130 | + /** |
|
| 131 | + * @param string $body |
|
| 132 | + */ |
|
| 127 | 133 | protected function validateRequest($method, $uri, array $urlParameters, $body = null, $response = null) |
| 128 | 134 | { |
| 129 | 135 | $request = $this->createRequestMock($response); |
@@ -137,6 +143,12 @@ discard block |
||
| 137 | 143 | return $request; |
| 138 | 144 | } |
| 139 | 145 | |
| 146 | + /** |
|
| 147 | + * @param string $method |
|
| 148 | + * @param string $uri |
|
| 149 | + * @param integer $statusCode |
|
| 150 | + * @param string $type |
|
| 151 | + */ |
|
| 140 | 152 | protected function validateRetrieveApiCall($method, $uri, array $urlParameters, $statusCode, $type, $transformedResult, array $serializerMap = array()) |
| 141 | 153 | { |
| 142 | 154 | $rawResponse = 'the-server-response'; |
@@ -166,6 +178,11 @@ discard block |
||
| 166 | 178 | } |
| 167 | 179 | } |
| 168 | 180 | |
| 181 | + /** |
|
| 182 | + * @param string $method |
|
| 183 | + * @param string $uri |
|
| 184 | + * @param string $rawResponse |
|
| 185 | + */ |
|
| 169 | 186 | protected function validateStoreApiCall($method, $uri, array $urlParameters, $statusCode, $rawResponse, $object, array $serializerMap = array()) |
| 170 | 187 | { |
| 171 | 188 | $rawRequest = 'the-request-body'; |
@@ -181,6 +198,9 @@ discard block |
||
| 181 | 198 | $this->validateSerializer($serializerMap); |
| 182 | 199 | } |
| 183 | 200 | |
| 201 | + /** |
|
| 202 | + * @param string $uri |
|
| 203 | + */ |
|
| 184 | 204 | protected function validateDeleteDocumentCall($uri, array $urlParameters, array $serializerMap = array()) |
| 185 | 205 | { |
| 186 | 206 | $response = $this->createResponseMock(204, ''); |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | ->serializer |
| 84 | 84 | ->expects($this->any()) |
| 85 | 85 | ->method('serialize') |
| 86 | - ->will($this->returnCallback(function ($data) use ($serializerMap) { |
|
| 86 | + ->will($this->returnCallback(function($data) use ($serializerMap) { |
|
| 87 | 87 | foreach ($serializerMap as $entry) { |
| 88 | 88 | if ($data == $entry['data']) { |
| 89 | 89 | return $entry['result']; |
@@ -12,7 +12,6 @@ |
||
| 12 | 12 | namespace Xabbuh\XApi\Client\Api; |
| 13 | 13 | |
| 14 | 14 | use Xabbuh\XApi\Client\Request\HandlerInterface; |
| 15 | -use Xabbuh\XApi\Model\IRL; |
|
| 16 | 15 | use Xabbuh\XApi\Model\StatementId; |
| 17 | 16 | use Xabbuh\XApi\Serializer\ActorSerializerInterface; |
| 18 | 17 | use Xabbuh\XApi\Serializer\StatementResultSerializerInterface; |