|
@@ 39-52 (lines=14) @@
|
| 36 |
|
/** |
| 37 |
|
* @test |
| 38 |
|
*/ |
| 39 |
|
public function willAddServerErrorResponse() |
| 40 |
|
{ |
| 41 |
|
$fixer = new SwaggerBundleResponseFixer(); |
| 42 |
|
$document = new SwaggerDocument(__DIR__ . '/assets/minimal.yml'); |
| 43 |
|
$fixer->fix($document); |
| 44 |
|
|
| 45 |
|
$definition = $document->getDefinition(); |
| 46 |
|
$this->assertArrayHasKey('responses', $definition); |
| 47 |
|
$this->assertArrayHasKey('ServerError', $definition['responses']); |
| 48 |
|
$this->assertArrayHasKey('description', $definition['responses']['ServerError']); |
| 49 |
|
$this->assertArrayHasKey('schema', $definition['responses']['ServerError']); |
| 50 |
|
$this->assertArrayHasKey('$ref', $definition['responses']['ServerError']['schema']); |
| 51 |
|
$this->assertSame($definition['responses']['ServerError']['schema']['$ref'], '#/definitions/VndError'); |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
/** |
| 55 |
|
* @test |
|
@@ 72-85 (lines=14) @@
|
| 69 |
|
/** |
| 70 |
|
* @test |
| 71 |
|
*/ |
| 72 |
|
public function willAddInputErrorResponse() |
| 73 |
|
{ |
| 74 |
|
$fixer = new SwaggerBundleResponseFixer(); |
| 75 |
|
$document = new SwaggerDocument(__DIR__ . '/assets/minimal.yml'); |
| 76 |
|
$fixer->fix($document); |
| 77 |
|
|
| 78 |
|
$definition = $document->getDefinition(); |
| 79 |
|
$this->assertArrayHasKey('responses', $definition); |
| 80 |
|
$this->assertArrayHasKey('InputError', $definition['responses']); |
| 81 |
|
$this->assertArrayHasKey('description', $definition['responses']['InputError']); |
| 82 |
|
$this->assertArrayHasKey('schema', $definition['responses']['InputError']); |
| 83 |
|
$this->assertArrayHasKey('$ref', $definition['responses']['InputError']['schema']); |
| 84 |
|
$this->assertSame($definition['responses']['InputError']['schema']['$ref'], '#/definitions/VndError'); |
| 85 |
|
} |
| 86 |
|
|
| 87 |
|
/** |
| 88 |
|
* @test |