|
@@ 169-177 (lines=9) @@
|
| 166 |
|
/** |
| 167 |
|
* @test |
| 168 |
|
*/ |
| 169 |
|
public function canResolveResourceSchemaReferences() |
| 170 |
|
{ |
| 171 |
|
$document = self::getPetStoreDocument(); |
| 172 |
|
$schemas = $document->getResourceSchemas(); |
| 173 |
|
$propertySchema = $schemas['Pet']['properties']['category']; |
| 174 |
|
$this->assertArrayNotHasKey('$ref', $propertySchema); |
| 175 |
|
$this->assertArrayHasKey('id', $propertySchema); |
| 176 |
|
$this->assertSame('object', $propertySchema['type']); |
| 177 |
|
} |
| 178 |
|
|
| 179 |
|
/** |
| 180 |
|
* @test |
|
@@ 182-190 (lines=9) @@
|
| 179 |
|
/** |
| 180 |
|
* @test |
| 181 |
|
*/ |
| 182 |
|
public function canResolveParameterSchemaReferences() |
| 183 |
|
{ |
| 184 |
|
$document = new SwaggerDocument('src/Tests/Functional/PetStore/app/swagger/instagram.yml'); |
| 185 |
|
$pathDefinitions = $document->getPathDefinitions(); |
| 186 |
|
$argumentPseudoSchema = $pathDefinitions['/users/{user-id}']['parameters'][0]; |
| 187 |
|
$this->assertArrayNotHasKey('$ref', $argumentPseudoSchema); |
| 188 |
|
$this->assertArrayHasKey('in', $argumentPseudoSchema); |
| 189 |
|
$this->assertSame('user-id', $argumentPseudoSchema['name']); |
| 190 |
|
} |
| 191 |
|
|
| 192 |
|
/** |
| 193 |
|
* @return SwaggerDocument |