|
@@ 55-64 (lines=10) @@
|
| 52 |
|
* @expectedException \Symfony\Component\HttpKernel\Exception\BadRequestHttpException |
| 53 |
|
* @expectedExceptionMessage Request body is empty |
| 54 |
|
*/ |
| 55 |
|
public function testEmptyRequest() |
| 56 |
|
{ |
| 57 |
|
$configuration = $this->createConfiguration(); |
| 58 |
|
|
| 59 |
|
$request = $this->createRequest(); |
| 60 |
|
$hydrator = $this->createMock(DocumentHydrator::class); |
| 61 |
|
$converter = new JsonApiDocumentParameterConverter($hydrator); |
| 62 |
|
|
| 63 |
|
$converter->apply($request, $configuration); |
| 64 |
|
} |
| 65 |
|
|
| 66 |
|
/** |
| 67 |
|
* @expectedException \Symfony\Component\HttpKernel\Exception\BadRequestHttpException |
|
@@ 70-79 (lines=10) @@
|
| 67 |
|
* @expectedException \Symfony\Component\HttpKernel\Exception\BadRequestHttpException |
| 68 |
|
* @expectedExceptionMessageRegExp ~Invalid media\-type of request~ |
| 69 |
|
*/ |
| 70 |
|
public function testInvalidContentType() |
| 71 |
|
{ |
| 72 |
|
$configuration = $this->createConfiguration(); |
| 73 |
|
|
| 74 |
|
$request = $this->createRequest('{}', false); |
| 75 |
|
$hydrator = $this->createMock(DocumentHydrator::class); |
| 76 |
|
$converter = new JsonApiDocumentParameterConverter($hydrator); |
| 77 |
|
|
| 78 |
|
$converter->apply($request, $configuration); |
| 79 |
|
} |
| 80 |
|
|
| 81 |
|
/** |
| 82 |
|
* @expectedException \Symfony\Component\HttpKernel\Exception\BadRequestHttpException |
|
@@ 85-94 (lines=10) @@
|
| 82 |
|
* @expectedException \Symfony\Component\HttpKernel\Exception\BadRequestHttpException |
| 83 |
|
* @expectedExceptionMessageRegExp ~Decoding error~ |
| 84 |
|
*/ |
| 85 |
|
public function testInvalidBody() |
| 86 |
|
{ |
| 87 |
|
$configuration = $this->createConfiguration(); |
| 88 |
|
|
| 89 |
|
$request = $this->createRequest('{'); |
| 90 |
|
$hydrator = $this->createMock(DocumentHydrator::class); |
| 91 |
|
$converter = new JsonApiDocumentParameterConverter($hydrator); |
| 92 |
|
|
| 93 |
|
$converter->apply($request, $configuration); |
| 94 |
|
} |
| 95 |
|
|
| 96 |
|
/** |
| 97 |
|
* @expectedException \Symfony\Component\HttpKernel\Exception\BadRequestHttpException |