|
@@ 27-37 (lines=11) @@
|
| 24 |
|
|
| 25 |
|
final class JsonRpcControllerTest extends TestCase |
| 26 |
|
{ |
| 27 |
|
public function testEmptyBatchRequestHandling() |
| 28 |
|
{ |
| 29 |
|
$controller = $this->createController(); |
| 30 |
|
|
| 31 |
|
$request = $this->createJsonRequest('/', []); |
| 32 |
|
$response = $controller->jsonRpcAction($request); |
| 33 |
|
|
| 34 |
|
self::assertInstanceOf(JsonRpcHttpResponse::class, $response); |
| 35 |
|
self::assertTrue($response->isSuccessful()); |
| 36 |
|
self::assertEquals('[]', $response->getContent()); |
| 37 |
|
} |
| 38 |
|
|
| 39 |
|
public function getInvalidJsonRequests() |
| 40 |
|
{ |
|
@@ 115-126 (lines=12) @@
|
| 112 |
|
* @param array $content |
| 113 |
|
* @param string $responseBody |
| 114 |
|
*/ |
| 115 |
|
public function testValidRequestHandling($content, $responseBody) |
| 116 |
|
{ |
| 117 |
|
$controller = $this->createController(); |
| 118 |
|
$request = $this->createJsonRequest( |
| 119 |
|
'/', |
| 120 |
|
$content |
| 121 |
|
); |
| 122 |
|
$response = $controller->jsonRpcAction($request); |
| 123 |
|
|
| 124 |
|
self::assertTrue($response->isSuccessful()); |
| 125 |
|
self::assertEquals($responseBody, $response->getContent()); |
| 126 |
|
} |
| 127 |
|
|
| 128 |
|
public function testExceptionHandling() |
| 129 |
|
{ |