Skip to content

Commit 6592682

Browse files
committed
fix: Skip FilenameTest integration tests when no API token available
Add token check to setUp() to properly skip tests when MARKETDATA_TOKEN is not set, matching other integration tests.
1 parent 4d126bc commit 6592682

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

tests/Integration/FilenameTest.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,17 @@ class FilenameTest extends TestCase
2424
protected function setUp(): void
2525
{
2626
parent::setUp();
27-
$this->client = new Client();
27+
28+
// Use the same robust token detection as Settings class
29+
$token = getenv('MARKETDATA_TOKEN');
30+
if ($token === false || $token === '') {
31+
$token = $_ENV['MARKETDATA_TOKEN'] ?? $_SERVER['MARKETDATA_TOKEN'] ?? null;
32+
}
33+
if ($token === null || $token === '') {
34+
$this->markTestSkipped('MARKETDATA_TOKEN environment variable not set');
35+
}
36+
37+
$this->client = new Client($token);
2838
}
2939

3040
public function testFilename_createsFile(): void

0 commit comments

Comments
 (0)