| @@ 105-113 (lines=9) @@ | ||
| 102 | * |
|
| 103 | * @expectedException \KleijnWeb\SwaggerBundle\Exception\MalformedContentException |
|
| 104 | */ |
|
| 105 | public function willThrowMalformedContentExceptionWhenDecodingFails() |
|
| 106 | { |
|
| 107 | $content = 'lkjhlkj'; |
|
| 108 | $request = TestRequestFactory::create($content, [], 'faux'); |
|
| 109 | $request->headers->set('Content-Type', 'application/json'); |
|
| 110 | ||
| 111 | $operationObject = Operation::createFromOperationDefinition((object)[]); |
|
| 112 | $this->contentDecoder->decodeContent($request, $operationObject); |
|
| 113 | } |
|
| 114 | ||
| 115 | /** |
|
| 116 | * @test |
|
| @@ 104-113 (lines=10) @@ | ||
| 101 | * |
|
| 102 | * @expectedException \KleijnWeb\SwaggerBundle\Exception\MalformedContentException |
|
| 103 | */ |
|
| 104 | public function willThrowMalformedContentExceptionWhenDecodingFails() |
|
| 105 | { |
|
| 106 | $content = 'NOT VALID JSON'; |
|
| 107 | $request = TestRequestFactory::create($content, [], 'faux'); |
|
| 108 | $request->headers->set('Content-Type', 'application/json'); |
|
| 109 | ||
| 110 | $operationObject = Operation::createFromOperationDefinition((object)[]); |
|
| 111 | ||
| 112 | $this->contentDecoder->decodeContent($request, $operationObject); |
|
| 113 | } |
|
| 114 | } |
|
| 115 | ||