Skip to content

Commit 0eea2e2

Browse files
committed
updated env params to include objects or array
1 parent c2ae94f commit 0eea2e2

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

guides/06-ModulesAndHelpers.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -400,31 +400,28 @@ Parameters can be loaded from environment vars, from yaml (Symfony format), .env
400400
Use the `params` section of the global configuration file `codeception.yml` to specify how to load them.
401401
You can specify several sources for parameters to be loaded from.
402402

403-
Example: load parameters from Fhe environment:
403+
Example: load parameters from the environment:
404404

405405
```yaml
406406
params:
407407
- env # load params from environment vars
408-
409408
```
410409

411-
Example: load parameters from FAML file (Symfony):
410+
Example: load parameters from YAML file (Symfony):
412411

413412
```yaml
414413
params:
415414
- app/config/parameters.yml
416-
417415
```
418416

419-
Example: load parameters from Fhp file (Yii)
420-
```yaml
417+
Example: load parameters from php file (Yii)
421418

419+
```yaml
422420
params:
423421
- config/params.php
424-
425422
```
426423

427-
Example: load parameters from .Fnv files (Laravel):
424+
Example: load parameters from .Env files (Laravel):
428425

429426
```yaml
430427
params:
@@ -451,7 +448,6 @@ modules:
451448
Parameters are also useful Fo provide connection credentials for the `Db` module (taken from Laravel's .env files):
452449

453450
```yaml
454-
455451
modules:
456452
enabled:
457453
- Db:
@@ -461,6 +457,16 @@ modules:
461457
462458
```
463459

460+
Parameters can set in JSON format. So objects, arrays, booleans and strings can also be passed into config.
461+
462+
```yaml
463+
modules:
464+
enabled:
465+
- \Tests\Support\DataHelper:
466+
users: %USERS_ARRAY%
467+
books: %BOOKS_ARRAY%
468+
```
469+
464470
### Runtime Configuration
465471

466472
If you want to reconfigure a module at runtime, you need to call a [helper](#Helpers) that uses the `_reconfigure` method of the module.

0 commit comments

Comments
 (0)