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

Lines changed: 4 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy