@@ -330,7 +330,7 @@ public function test_uri_is_correct()
330
330
$ this ->assertEquals ($ targetRequest ['request ' ]['url ' ]['raw ' ], '{{base_url}}/example/phpDocRoute ' );
331
331
}
332
332
333
- public function test_api_resource_routes_set_parameters_correctly ()
333
+ public function test_api_resource_routes_set_parameters_correctly_with_hyphens ()
334
334
{
335
335
$ this ->artisan ('export:postman ' )->assertExitCode (0 );
336
336
@@ -345,6 +345,21 @@ public function test_api_resource_routes_set_parameters_correctly()
345
345
$ this ->assertEquals ($ targetRequest ['request ' ]['url ' ]['raw ' ], '{{base_url}}/example/users/:user/audit-logs/:audit_log ' );
346
346
}
347
347
348
+ public function test_api_resource_routes_set_parameters_correctly_with_underscores ()
349
+ {
350
+ $ this ->artisan ('export:postman ' )->assertExitCode (0 );
351
+
352
+ $ collection = collect (json_decode (Storage::get ('postman/ ' .config ('api-postman.filename ' )), true )['item ' ]);
353
+
354
+ $ targetRequest = $ collection
355
+ ->where ('name ' , 'example/users/{user}/other_logs/{other_log} ' )
356
+ ->where ('request.method ' , 'PATCH ' )
357
+ ->first ();
358
+
359
+ $ this ->assertEquals ($ targetRequest ['name ' ], 'example/users/{user}/other_logs/{other_log} ' );
360
+ $ this ->assertEquals ($ targetRequest ['request ' ]['url ' ]['raw ' ], '{{base_url}}/example/users/:user/other_logs/:other_log ' );
361
+ }
362
+
348
363
public static function providerFormDataEnabled (): array
349
364
{
350
365
return [
@@ -359,7 +374,7 @@ public static function providerFormDataEnabled(): array
359
374
360
375
private function countCollectionItems (array $ collectionItems )
361
376
{
362
- $ sum = -1 ;
377
+ $ sum = -2 ;
363
378
364
379
foreach ($ collectionItems as $ item ) {
365
380
$ sum += $ this ->retrieveRoutes ($ item );
0 commit comments