Skip to content

Commit 6318370

Browse files
ThomasTrdunglas
andauthored
Allow custom environment variables (#451)
* Send custom environment variables to the web server e.g. different test_case * rename env for consistency Co-authored-by: Kévin Dunglas <[email protected]>
1 parent 0ef1deb commit 6318370

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/PantherTestCaseTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ trait PantherTestCaseTrait
7575
'external_base_uri' => null,
7676
'readinessPath' => '',
7777
'browser' => PantherTestCase::CHROME,
78+
'env' => [],
7879
];
7980

8081
public static function tearDownAfterClass(): void
@@ -130,6 +131,7 @@ public static function startWebServer(array $options = []): void
130131
'port' => (int) ($options['port'] ?? $_SERVER['PANTHER_WEB_SERVER_PORT'] ?? self::$defaultOptions['port']),
131132
'router' => $options['router'] ?? $_SERVER['PANTHER_WEB_SERVER_ROUTER'] ?? self::$defaultOptions['router'],
132133
'readinessPath' => $options['readinessPath'] ?? $_SERVER['PANTHER_READINESS_PATH'] ?? self::$defaultOptions['readinessPath'],
134+
'env' => (array) ($options['env'] ?? self::$defaultOptions['env']),
133135
];
134136

135137
self::$webServerManager = new WebServerManager(...array_values($options));

0 commit comments

Comments
 (0)