6
6
use Illuminate \Support \Facades \Storage ;
7
7
use Illuminate \Support \Facades \View ;
8
8
use Illuminate \Support \Str ;
9
- use Knuckles \Scribe \Config \Defaults ;
10
9
use Knuckles \Scribe \Tests \BaseLaravelTest ;
11
10
use Knuckles \Scribe \Tests \Fixtures \TestController ;
12
11
use Knuckles \Scribe \Tests \Fixtures \TestGroupController ;
22
21
use Symfony \Component \DomCrawler \Crawler ;
23
22
use Symfony \Component \Yaml \Yaml ;
24
23
use Knuckles \Scribe \Extracting \Strategies ;
25
- use function Knuckles \Scribe \Config \mergeResults ;
26
24
use function Knuckles \Scribe \Config \withConfiguredStrategy ;
27
25
28
26
class OutputTest extends BaseLaravelTest
@@ -140,9 +138,10 @@ public function generated_postman_collection_file_is_correct()
140
138
'postman.overrides ' => [
141
139
'info.version ' => '3.9.9 ' ,
142
140
],
143
- 'strategies.headers ' => mergeResults (config ('scribe.strategies.headers ' ), [
144
- 'Custom-Header ' => 'NotSoCustom ' ,
145
- ]),
141
+ 'strategies.headers ' => [
142
+ ...config ('scribe.strategies.headers ' ),
143
+ Strategies \StaticData::withSettings (data: ['Custom-Header ' => 'NotSoCustom ' ]),
144
+ ],
146
145
]);
147
146
$ this ->enableResponseCalls ();
148
147
@@ -201,9 +200,10 @@ public function generated_openapi_spec_file_is_correct()
201
200
'openapi.overrides ' => [
202
201
'info.version ' => '3.9.9 ' ,
203
202
],
204
- 'strategies.headers ' => mergeResults (Defaults::HEADERS_STRATEGIES , [
205
- 'Custom-Header ' => 'NotSoCustom ' ,
206
- ]),
203
+ 'strategies.headers ' => [
204
+ ...config ('scribe.strategies.headers ' ),
205
+ Strategies \StaticData::withSettings (data: ['Custom-Header ' => 'NotSoCustom ' ]),
206
+ ],
207
207
]);
208
208
$ this ->enableResponseCalls ();
209
209
@@ -218,24 +218,6 @@ public function generated_openapi_spec_file_is_correct()
218
218
$ this ->assertEquals ($ fixtureSpec , $ generatedSpec );
219
219
}
220
220
221
- /** @test */
222
- public function can_append_custom_http_headers ()
223
- {
224
- RouteFacade::get ('/api/headers ' , [TestController::class, 'checkCustomHeaders ' ]);
225
- $ this ->setConfig ([
226
- 'strategies.headers ' => mergeResults (Defaults::HEADERS_STRATEGIES , [
227
- 'Authorization ' => 'customAuthToken ' ,
228
- 'Custom-Header ' => 'NotSoCustom ' ,
229
- ]
230
- ),
231
- ]);
232
- $ this ->generate ();
233
-
234
- $ endpointDetails = Yaml::parseFile ('.scribe/endpoints/00.yaml ' )['endpoints ' ][0 ];
235
- $ this ->assertEquals ("customAuthToken " , $ endpointDetails ['headers ' ]["Authorization " ]);
236
- $ this ->assertEquals ("NotSoCustom " , $ endpointDetails ['headers ' ]["Custom-Header " ]);
237
- }
238
-
239
221
/** @test */
240
222
public function can_parse_utf8_response ()
241
223
{
0 commit comments