Skip to content

Commit 9762203

Browse files
committed
test(metadata): add more tests
1 parent f6c8d6b commit 9762203

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/Fixtures/TestBundle/ApiResource/WithParameter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@
294294
'foo_as_default' => new QueryParameter(
295295
default: 'foo',
296296
),
297+
'required_with_a_default' => new QueryParameter(
298+
required: true,
299+
default: 'bar'
300+
),
297301
],
298302
provider: [self::class, 'checkParameterDefaults'],
299303
)]
@@ -393,6 +397,7 @@ public static function checkParameterDefaults(Operation $operation, array $uriVa
393397
Assertion::false($operation->getParameters()->get('false_as_default')->getValue());
394398
Assertion::true($operation->getParameters()->get('true_as_default')->getValue());
395399
Assertion::same($operation->getParameters()->get('foo_as_default')->getValue(), 'foo');
400+
Assertion::same($operation->getParameters()->get('required_with_a_default')->getValue(), 'bar');
396401

397402
return new JsonResponse([]);
398403
}

0 commit comments

Comments
 (0)