@@ -68,6 +68,12 @@ public function testParametersWithClassNameAsKey(): void
6868 {
6969 $ config = [
7070 'api_platform ' => [
71+ 'title ' => 'Test API ' ,
72+ 'description ' => 'Test Description ' ,
73+ 'version ' => '1.0.0 ' ,
74+ 'formats ' => ['json ' => ['mime_types ' => ['application/json ' ]]],
75+ 'error_formats ' => [],
76+ 'patch_formats ' => [],
7177 'defaults ' => [
7278 'parameters ' => [
7379 'ApiPlatform\Metadata\HeaderParameter ' => [
@@ -89,6 +95,7 @@ public function testParametersWithClassNameAsKey(): void
8995 $ defaults = $ this ->container ->getParameter ('api_platform.defaults ' );
9096 $ this ->assertArrayHasKey ('parameters ' , $ defaults );
9197
98+ /** @var Parameters $parameters */
9299 $ parameters = $ defaults ['parameters ' ];
93100 $ this ->assertInstanceOf (Parameters::class, $ parameters );
94101
@@ -109,6 +116,12 @@ public function testMixedParameterDefinitions(): void
109116 {
110117 $ config = [
111118 'api_platform ' => [
119+ 'title ' => 'Test API ' ,
120+ 'description ' => 'Test Description ' ,
121+ 'version ' => '1.0.0 ' ,
122+ 'formats ' => ['json ' => ['mime_types ' => ['application/json ' ]]],
123+ 'error_formats ' => [],
124+ 'patch_formats ' => [],
112125 'defaults ' => [
113126 'parameters ' => [
114127 'ApiPlatform\Metadata\HeaderParameter ' => [
@@ -127,10 +140,8 @@ public function testMixedParameterDefinitions(): void
127140 (new ApiPlatformExtension ())->load ($ config , $ this ->container );
128141
129142 $ defaults = $ this ->container ->getParameter ('api_platform.defaults ' );
130- $ this ->assertArrayHasKey ('parameters ' , $ defaults );
131-
143+ /** @var Parameters $parameters */
132144 $ parameters = $ defaults ['parameters ' ];
133- $ this ->assertInstanceOf (Parameters::class, $ parameters );
134145
135146 $ paramArray = iterator_to_array ($ parameters );
136147
@@ -145,6 +156,12 @@ public function testMultipleHeaderParameters(): void
145156 {
146157 $ config = [
147158 'api_platform ' => [
159+ 'title ' => 'Test API ' ,
160+ 'description ' => 'Test Description ' ,
161+ 'version ' => '1.0.0 ' ,
162+ 'formats ' => ['json ' => ['mime_types ' => ['application/json ' ]]],
163+ 'error_formats ' => [],
164+ 'patch_formats ' => [],
148165 'defaults ' => [
149166 'parameters ' => [
150167 'ApiPlatform\Metadata\HeaderParameter ' => [
@@ -159,10 +176,8 @@ public function testMultipleHeaderParameters(): void
159176 (new ApiPlatformExtension ())->load ($ config , $ this ->container );
160177
161178 $ defaults = $ this ->container ->getParameter ('api_platform.defaults ' );
162- $ this ->assertArrayHasKey ('parameters ' , $ defaults );
163-
179+ /** @var Parameters $parameters */
164180 $ parameters = $ defaults ['parameters ' ];
165- $ this ->assertInstanceOf (Parameters::class, $ parameters );
166181
167182 $ paramArray = iterator_to_array ($ parameters );
168183 $ this ->assertNotEmpty ($ paramArray );
0 commit comments