6969use Prophecy \Argument ;
7070use Prophecy \PhpUnit \ProphecyTrait ;
7171use Psr \Container \ContainerInterface ;
72- use Symfony \Component \PropertyInfo \Type ;
7372use Symfony \Component \Serializer \NameConverter \CamelCaseToSnakeCaseNameConverter ;
73+ use Symfony \Component \TypeInfo \Type ;
7474
7575class OpenApiFactoryTest extends TestCase
7676{
@@ -303,7 +303,7 @@ public function testInvoke(): void
303303 $ propertyMetadataFactoryProphecy = $ this ->prophesize (PropertyMetadataFactoryInterface::class);
304304 $ propertyMetadataFactoryProphecy ->create (Dummy::class, 'id ' , Argument::any ())->shouldBeCalled ()->willReturn (
305305 (new ApiProperty ())
306- ->withBuiltinTypes ([ new Type (Type:: BUILTIN_TYPE_INT )] )
306+ ->withNativeType ( Type:: int () )
307307 ->withDescription ('This is an id. ' )
308308 ->withReadable (true )
309309 ->withWritable (false )
@@ -312,7 +312,7 @@ public function testInvoke(): void
312312 );
313313 $ propertyMetadataFactoryProphecy ->create (Dummy::class, 'name ' , Argument::any ())->shouldBeCalled ()->willReturn (
314314 (new ApiProperty ())
315- ->withBuiltinTypes ([ new Type (Type:: BUILTIN_TYPE_STRING )] )
315+ ->withNativeType ( Type:: string () )
316316 ->withDescription ('This is a name. ' )
317317 ->withReadable (true )
318318 ->withWritable (true )
@@ -324,7 +324,7 @@ public function testInvoke(): void
324324 );
325325 $ propertyMetadataFactoryProphecy ->create (Dummy::class, 'description ' , Argument::any ())->shouldBeCalled ()->willReturn (
326326 (new ApiProperty ())
327- ->withBuiltinTypes ([ new Type (Type:: BUILTIN_TYPE_STRING )] )
327+ ->withNativeType ( Type:: string () )
328328 ->withDescription ('This is an initializable but not writable property. ' )
329329 ->withReadable (true )
330330 ->withWritable (false )
@@ -337,7 +337,7 @@ public function testInvoke(): void
337337 );
338338 $ propertyMetadataFactoryProphecy ->create (Dummy::class, 'dummyDate ' , Argument::any ())->shouldBeCalled ()->willReturn (
339339 (new ApiProperty ())
340- ->withBuiltinTypes ([ new Type (Type::BUILTIN_TYPE_OBJECT , true , \DateTime::class)] )
340+ ->withNativeType ( Type:: nullable (Type::object ( \DateTime::class)) )
341341 ->withDescription ('This is a \DateTimeInterface object. ' )
342342 ->withReadable (true )
343343 ->withWritable (true )
@@ -349,7 +349,7 @@ public function testInvoke(): void
349349 );
350350 $ propertyMetadataFactoryProphecy ->create (Dummy::class, 'enum ' , Argument::any ())->shouldBeCalled ()->willReturn (
351351 (new ApiProperty ())
352- ->withBuiltinTypes ([ new Type (Type:: BUILTIN_TYPE_STRING )] )
352+ ->withNativeType ( Type:: string () )
353353 ->withDescription ('This is an enum. ' )
354354 ->withReadable (true )
355355 ->withWritable (true )
@@ -362,7 +362,7 @@ public function testInvoke(): void
362362 );
363363 $ propertyMetadataFactoryProphecy ->create (OutputDto::class, 'id ' , Argument::any ())->shouldBeCalled ()->willReturn (
364364 (new ApiProperty ())
365- ->withBuiltinTypes ([ new Type (Type:: BUILTIN_TYPE_INT )] )
365+ ->withNativeType ( Type:: int () )
366366 ->withDescription ('This is an id. ' )
367367 ->withReadable (true )
368368 ->withWritable (false )
@@ -371,7 +371,7 @@ public function testInvoke(): void
371371 );
372372 $ propertyMetadataFactoryProphecy ->create (OutputDto::class, 'name ' , Argument::any ())->shouldBeCalled ()->willReturn (
373373 (new ApiProperty ())
374- ->withBuiltinTypes ([ new Type (Type:: BUILTIN_TYPE_STRING )] )
374+ ->withNativeType ( Type:: string () )
375375 ->withDescription ('This is a name. ' )
376376 ->withReadable (true )
377377 ->withWritable (true )
@@ -383,7 +383,7 @@ public function testInvoke(): void
383383 );
384384 $ propertyMetadataFactoryProphecy ->create (OutputDto::class, 'description ' , Argument::any ())->shouldBeCalled ()->willReturn (
385385 (new ApiProperty ())
386- ->withBuiltinTypes ([ new Type (Type:: BUILTIN_TYPE_STRING )] )
386+ ->withNativeType ( Type:: string () )
387387 ->withDescription ('This is an initializable but not writable property. ' )
388388 ->withReadable (true )
389389 ->withWritable (false )
@@ -394,7 +394,7 @@ public function testInvoke(): void
394394 );
395395 $ propertyMetadataFactoryProphecy ->create (OutputDto::class, 'dummyDate ' , Argument::any ())->shouldBeCalled ()->willReturn (
396396 (new ApiProperty ())
397- ->withBuiltinTypes ([ new Type (Type::BUILTIN_TYPE_OBJECT , true , \DateTime::class)] )
397+ ->withNativeType ( Type:: nullable (Type::object ( \DateTime::class)) )
398398 ->withDescription ('This is a \DateTimeInterface object. ' )
399399 ->withReadable (true )
400400 ->withWritable (true )
@@ -404,7 +404,7 @@ public function testInvoke(): void
404404 );
405405 $ propertyMetadataFactoryProphecy ->create (OutputDto::class, 'enum ' , Argument::any ())->shouldBeCalled ()->willReturn (
406406 (new ApiProperty ())
407- ->withBuiltinTypes ([ new Type (Type:: BUILTIN_TYPE_STRING )] )
407+ ->withNativeType ( Type:: string () )
408408 ->withDescription ('This is an enum. ' )
409409 ->withReadable (true )
410410 ->withWritable (true )
@@ -417,7 +417,7 @@ public function testInvoke(): void
417417 foreach ([DummyErrorResource::class, Error::class] as $ cl ) {
418418 $ propertyMetadataFactoryProphecy ->create ($ cl , 'type ' , Argument::any ())->shouldBeCalled ()->willReturn (
419419 (new ApiProperty ())
420- ->withBuiltinTypes ([ new Type (Type:: BUILTIN_TYPE_STRING )] )
420+ ->withNativeType ( Type:: string () )
421421 ->withDescription ('This is an error type. ' )
422422 ->withReadable (true )
423423 ->withWritable (false )
@@ -428,7 +428,7 @@ public function testInvoke(): void
428428 );
429429 $ propertyMetadataFactoryProphecy ->create ($ cl , 'title ' , Argument::any ())->shouldBeCalled ()->willReturn (
430430 (new ApiProperty ())
431- ->withBuiltinTypes ([ new Type (Type:: BUILTIN_TYPE_STRING )] )
431+ ->withNativeType ( Type:: string () )
432432 ->withDescription ('This is an error title. ' )
433433 ->withReadable (true )
434434 ->withWritable (false )
@@ -439,7 +439,7 @@ public function testInvoke(): void
439439 );
440440 $ propertyMetadataFactoryProphecy ->create ($ cl , 'status ' , Argument::any ())->shouldBeCalled ()->willReturn (
441441 (new ApiProperty ())
442- ->withBuiltinTypes ([ new Type (Type:: BUILTIN_TYPE_INT )] )
442+ ->withNativeType ( Type:: int () )
443443 ->withDescription ('This is an error status. ' )
444444 ->withReadable (true )
445445 ->withWritable (false )
@@ -448,7 +448,7 @@ public function testInvoke(): void
448448 );
449449 $ propertyMetadataFactoryProphecy ->create ($ cl , 'detail ' , Argument::any ())->shouldBeCalled ()->willReturn (
450450 (new ApiProperty ())
451- ->withBuiltinTypes ([ new Type (Type:: BUILTIN_TYPE_STRING )] )
451+ ->withNativeType ( Type:: string () )
452452 ->withDescription ('This is an error detail. ' )
453453 ->withReadable (true )
454454 ->withWritable (false )
@@ -459,7 +459,7 @@ public function testInvoke(): void
459459 );
460460 $ propertyMetadataFactoryProphecy ->create ($ cl , 'instance ' , Argument::any ())->shouldBeCalled ()->willReturn (
461461 (new ApiProperty ())
462- ->withBuiltinTypes ([ new Type (Type:: BUILTIN_TYPE_STRING )] )
462+ ->withNativeType ( Type:: string () )
463463 ->withDescription ('This is an error instance. ' )
464464 ->withReadable (true )
465465 ->withWritable (false )
0 commit comments