From ab8c44f520a656ab6e6e32957fcc5b4cf0895d83 Mon Sep 17 00:00:00 2001 From: Guilhem Niot Date: Wed, 9 Sep 2020 08:52:15 +0200 Subject: [PATCH] Adapt https://github.com/nelmio/NelmioApiDocBundle/pull/1711 to 3.x --- .../SymfonyConstraintAnnotationReaderTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/ModelDescriber/Annotations/SymfonyConstraintAnnotationReaderTest.php b/Tests/ModelDescriber/Annotations/SymfonyConstraintAnnotationReaderTest.php index e30cb49..c781db1 100644 --- a/Tests/ModelDescriber/Annotations/SymfonyConstraintAnnotationReaderTest.php +++ b/Tests/ModelDescriber/Annotations/SymfonyConstraintAnnotationReaderTest.php @@ -61,18 +61,18 @@ class SymfonyConstraintAnnotationReaderTest extends TestCase private $property2; }; - $schema = new OA\Schema([]); - $schema->merge([new OA\Property(['property' => 'property1'])]); - $schema->merge([new OA\Property(['property' => 'property2'])]); + $schema = new Schema(); + $schema->getProperties()->set('property1', new Schema()); + $schema->getProperties()->set('property2', new Schema()); $symfonyConstraintAnnotationReader = new SymfonyConstraintAnnotationReader(new AnnotationReader()); $symfonyConstraintAnnotationReader->setSchema($schema); - $symfonyConstraintAnnotationReader->updateProperty(new \ReflectionProperty($entity, 'property1'), $schema->properties[0]); - $symfonyConstraintAnnotationReader->updateProperty(new \ReflectionProperty($entity, 'property2'), $schema->properties[1]); + $symfonyConstraintAnnotationReader->updateProperty(new \ReflectionProperty($entity, 'property1'), $schema->getProperties()->get('property1')); + $symfonyConstraintAnnotationReader->updateProperty(new \ReflectionProperty($entity, 'property2'), $schema->getProperties()->get('property2')); // expect required to be numeric array with sequential keys (not [0 => ..., 2 => ...]) - $this->assertEquals($schema->required, ['property2']); + $this->assertEquals($schema->getRequired(), ['property2']); } public function testAssertChoiceResultsInNumericArray()