11<?php
2+ declare (strict_types=1 );
23
34namespace SwaggerBake \Test \TestCase \Lib \MediaType ;
45
@@ -36,7 +37,7 @@ public function setUp(): void
3637 'controllers ' => ['\SwaggerBakeTest\App \\' ],
3738 'entities ' => ['\SwaggerBakeTest\App \\' ],
3839 'tables ' => ['\SwaggerBakeTest\App \\' ],
39- ]
40+ ],
4041 ], SWAGGER_BAKE_TEST_APP );
4142 }
4243
@@ -47,7 +48,7 @@ public function test_collection(): void
4748 $ schema = (new Generic ($ swagger ))->buildSchema ('#/components/schemas/thing ' , 'array ' );
4849 $ this ->assertEquals (
4950 '#/x-swagger-bake/components/schemas/Generic-Collection ' ,
50- $ schema ->getAllOf ()[0 ]['$ref ' ]
51+ $ schema ->getAllOf ()[0 ]['$ref ' ],
5152 );
5253 $ this ->assertArrayHasKey ('data ' , $ schema ->getProperties ());
5354 }
@@ -70,7 +71,7 @@ public function test_collection_with_associations(): void
7071 ->setName ('PostalCode ' )
7172 ->setProperties ([
7273 (new SchemaProperty ())->setName ('id ' ),
73- (new SchemaProperty ())->setName ('PostalCode ' )
74+ (new SchemaProperty ())->setName ('PostalCode ' ),
7475 ]),
7576 ]);
7677
@@ -81,8 +82,11 @@ public function test_collection_with_associations(): void
8182 $ this ->assertArrayHasKey ('PostalCode ' , $ items ['properties ' ]);
8283 $ this ->assertEquals (
8384 '#/x-swagger-bake/components/schemas/Generic-Collection ' ,
84- $ schema ->getAllOf ()[0 ]['$ref ' ]
85+ $ schema ->getAllOf ()[0 ]['$ref ' ],
8586 );
8687 $ this ->assertArrayHasKey ('data ' , $ schema ->getProperties ());
88+
89+ $ arr = json_decode (json_encode ($ schema ->toArray ()), true );
90+ $ this ->assertArrayHasKey ('Country ' , $ arr ['properties ' ]['data ' ]['items ' ]['properties ' ]);
8791 }
88- }
92+ }
0 commit comments