File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -198,9 +198,11 @@ public function getScenarios(): array
198
198
}
199
199
200
200
/**
201
+ * @param string $defaultDescription
201
202
* @return array
203
+ * @noinspection PhpSameParameterValueInspection
202
204
*/
203
- private function getScenariosByOpenapiSchema (): array
205
+ private function getScenariosByOpenapiSchema (string $ defaultDescription = " Scenario {name} " ): array
204
206
{
205
207
$ x_scenarios = $ this ->openapiSchema ->{'x-scenarios ' } ?? [];
206
208
if (empty ($ x_scenarios ) || !is_array ($ x_scenarios )) {
@@ -227,9 +229,11 @@ private function getScenariosByOpenapiSchema(): array
227
229
228
230
foreach ($ scenarios as $ key => $ scenario ) {
229
231
$ scenarios [$ key ]['const ' ] = 'SCENARIO_ ' . strtoupper ($ scenario ['name ' ]);
230
- $ scenarios [$ key ]['description ' ] = !empty ($ scenario ['description ' ]) ?
231
- FormatHelper::getFormattedDescription ($ scenario ['description ' ], 5 )
232
- : ' Scenario ' . $ scenario ['name ' ];
232
+ $ scenarios [$ key ]['description ' ] = FormatHelper::getFormattedDescription (
233
+ !empty ($ scenario ['description ' ]) ?
234
+ $ scenario ['description ' ]
235
+ : str_replace ('{name} ' , $ scenario ['name ' ], $ defaultDescription ),
236
+ 5 );
233
237
}
234
238
235
239
return $ scenarios ;
You can’t perform that action at this time.
0 commit comments