Skip to content

Commit a28420e

Browse files
test: skip ReadmeTest unless FUNCTIONAL_TESTS env var is set (#212)
This functional test makes HTTP requests to external servers and should not run in CI environments by default. Set FUNCTIONAL_TESTS=1 to enable. --------- Co-authored-by: Claude <[email protected]>
1 parent f4f84f8 commit a28420e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

tests/src/Unit/HarTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,23 @@ public function testSplitLogEntries(): void
5959
}
6060
}
6161

62+
public function testSetLog(): void
63+
{
64+
$creator = new \Deviantintegral\Har\Creator();
65+
$creator->setName('TestCreator');
66+
$creator->setVersion('1.0');
67+
68+
$log = (new Log())
69+
->setVersion('1.2')
70+
->setCreator($creator)
71+
->setEntries([]);
72+
73+
$har = (new Har())->setLog($log);
74+
75+
$this->assertSame($log, $har->getLog());
76+
$this->assertEquals('1.2', $har->getLog()->getVersion());
77+
}
78+
6279
public function testCloneBrowserIsDeep(): void
6380
{
6481
$repository = $this->getHarFileRepository();

tests/src/Unit/ReadmeTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ class ReadmeTest extends TestCase
1919
{
2020
public function testExample(): void
2121
{
22+
if (!getenv('FUNCTIONAL_TESTS')) {
23+
$this->markTestSkipped('Skipping functional test. Set FUNCTIONAL_TESTS=1 to run.');
24+
}
25+
2226
// Initialize a repository of HAR files, with IDs being the file names.
2327
$repository = new HarFileRepository(__DIR__.'/../../fixtures');
2428

0 commit comments

Comments
 (0)