From 2ffa0a9c7fb616059d413be349754f84eeefcfe5 Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Sat, 19 Nov 2022 22:20:52 +0200 Subject: [PATCH] Allow to set headers in module configuration --- src/Codeception/Module/Laravel.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Codeception/Module/Laravel.php b/src/Codeception/Module/Laravel.php index fcadb79..7f2c084 100644 --- a/src/Codeception/Module/Laravel.php +++ b/src/Codeception/Module/Laravel.php @@ -62,6 +62,7 @@ * * disable_events: `boolean`, default `false` - disable events (does not disable model events). * * disable_model_events: `boolean`, default `false` - disable model events. * * url: `string`, default `` - the application URL. + * * headers: `array` - default headers are set before each test. * * ### Example #1 (`functional.suite.yml`) * @@ -172,6 +173,7 @@ public function __construct(ModuleContainer $moduleContainer, ?array $config = n 'disable_middleware' => false, 'disable_events' => false, 'disable_model_events' => false, + 'headers' => [], ], (array)$config ); @@ -210,6 +212,8 @@ public function _initialize() */ public function _before(TestInterface $test) { + $this->headers = $this->config['headers']; + $this->client = new LaravelConnector($this); // Database migrations should run before database cleanup transaction starts