Skip to content

Commit

Permalink
Revert "Adapt #1711 to 3.x"
Browse files Browse the repository at this point in the history
This reverts commit ab8c44f.
  • Loading branch information
GuilhemN committed Sep 9, 2020
1 parent 865527b commit edd6857
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ public function testOptionalProperty()
private $property2;
};

$schema = new Schema();
$schema->getProperties()->set('property1', new Schema());
$schema->getProperties()->set('property2', new Schema());
$schema = new OA\Schema([]);
$schema->merge([new OA\Property(['property' => 'property1'])]);
$schema->merge([new OA\Property(['property' => 'property2'])]);

$symfonyConstraintAnnotationReader = new SymfonyConstraintAnnotationReader(new AnnotationReader());
$symfonyConstraintAnnotationReader->setSchema($schema);

$symfonyConstraintAnnotationReader->updateProperty(new \ReflectionProperty($entity, 'property1'), $schema->getProperties()->get('property1'));
$symfonyConstraintAnnotationReader->updateProperty(new \ReflectionProperty($entity, 'property2'), $schema->getProperties()->get('property2'));
$symfonyConstraintAnnotationReader->updateProperty(new \ReflectionProperty($entity, 'property1'), $schema->properties[0]);
$symfonyConstraintAnnotationReader->updateProperty(new \ReflectionProperty($entity, 'property2'), $schema->properties[1]);

// expect required to be numeric array with sequential keys (not [0 => ..., 2 => ...])
$this->assertEquals($schema->getRequired(), ['property2']);
$this->assertEquals($schema->required, ['property2']);
}

public function testAssertChoiceResultsInNumericArray()
Expand Down

0 comments on commit edd6857

Please sign in to comment.