Skip to content

Commit 2ffa0a9

Browse files
committed
Allow to set headers in module configuration
1 parent 994e3ff commit 2ffa0a9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Codeception/Module/Laravel.php

+4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
* * disable_events: `boolean`, default `false` - disable events (does not disable model events).
6363
* * disable_model_events: `boolean`, default `false` - disable model events.
6464
* * url: `string`, default `` - the application URL.
65+
* * headers: `array<string, string>` - default headers are set before each test.
6566
*
6667
* ### Example #1 (`functional.suite.yml`)
6768
*
@@ -172,6 +173,7 @@ public function __construct(ModuleContainer $moduleContainer, ?array $config = n
172173
'disable_middleware' => false,
173174
'disable_events' => false,
174175
'disable_model_events' => false,
176+
'headers' => [],
175177
],
176178
(array)$config
177179
);
@@ -210,6 +212,8 @@ public function _initialize()
210212
*/
211213
public function _before(TestInterface $test)
212214
{
215+
$this->headers = $this->config['headers'];
216+
213217
$this->client = new LaravelConnector($this);
214218

215219
// Database migrations should run before database cleanup transaction starts

0 commit comments

Comments
 (0)