From a387f9c5dd80d3db5f5176799e5a6a636626e21a Mon Sep 17 00:00:00 2001 From: DjordyKoert Date: Fri, 27 Oct 2023 16:01:39 +0200 Subject: [PATCH] Expand tests with required field --- OpenApiPhp/Util.php | 2 -- Tests/Functional/FunctionalTest.php | 20 +++++++++++++++++++ .../ValidationGroupsFunctionalTest.php | 4 ++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/OpenApiPhp/Util.php b/OpenApiPhp/Util.php index 2f1b04dae..dc0db90e8 100644 --- a/OpenApiPhp/Util.php +++ b/OpenApiPhp/Util.php @@ -155,8 +155,6 @@ public static function getOperationParameter(OA\Operation $operation, $name, $in * it is expected to be a string nested property. * * @see OA\AbstractAnnotation::$_nested - * - * @param $class */ public static function getChild(OA\AbstractAnnotation $parent, $class, array $properties = []): OA\AbstractAnnotation { diff --git a/Tests/Functional/FunctionalTest.php b/Tests/Functional/FunctionalTest.php index 7c9bb784d..235b9854a 100644 --- a/Tests/Functional/FunctionalTest.php +++ b/Tests/Functional/FunctionalTest.php @@ -242,6 +242,15 @@ public function testUserModel() ], ], 'schema' => 'User', + 'required' => [ + 'id', + 'roles', + 'money', + 'creationDate', + 'users', + 'status', + 'dateAsInterface', + ], ], json_decode($this->getModel('User')->toJson(), true) ); @@ -428,6 +437,17 @@ public function testSymfonyConstraintDocumentation() 'required' => [ 'propertyNotBlank', 'propertyNotNull', + 'propertyAssertLength', + 'propertyRegex', + 'propertyCount', + 'propertyChoice', + 'propertyChoiceWithCallback', + 'propertyChoiceWithCallbackWithoutClass', + 'propertyChoiceWithMultiple', + 'propertyExpression', + 'propertyRange', + 'propertyLessThan', + 'propertyLessThanOrEqual', ], 'properties' => [ 'propertyNotBlank' => [ diff --git a/Tests/Functional/ValidationGroupsFunctionalTest.php b/Tests/Functional/ValidationGroupsFunctionalTest.php index c8891eca6..e9ece6b72 100644 --- a/Tests/Functional/ValidationGroupsFunctionalTest.php +++ b/Tests/Functional/ValidationGroupsFunctionalTest.php @@ -75,6 +75,10 @@ public function testConstraintDefaultGroupsAreRespectedWhenReadingAnnotations() ], 'type' => 'object', 'schema' => 'SymfonyConstraintsDefaultGroup', + 'required' => [ + 'property', + 'propertyInDefaultGroup', + ], ]; $this->assertEquals(