From d3380e150bd559c7452fc23908cccd3874e71ef9 Mon Sep 17 00:00:00 2001 From: Sascha Egerer Date: Fri, 28 Jun 2024 17:36:40 +0200 Subject: [PATCH] Add "Examples" attribute example for associative keys --- docs/AdvancedUsage.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/AdvancedUsage.md b/docs/AdvancedUsage.md index be9aca38a..9f8b7ac47 100644 --- a/docs/AdvancedUsage.md +++ b/docs/AdvancedUsage.md @@ -265,6 +265,32 @@ class EndpointCest ``` +You can also use [named arguments](https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments) to get an example with associative keys. +```php +sendGet($example['url']); + $I->seeResponseCodeIs($example['expectedReponseCode']); + } +} + +``` + ## Example Annotation As well as the `\Codeception\Attribute\Examples` attribute, available for Cest tests, the `@example` attribute allows you to