Skip to content

Commit 674b1df

Browse files
committed
feat: Add test for handling profiler environment exclusion
1 parent 8f33996 commit 674b1df

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

tests/ProfilingDataTest.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ class ProfilingDataTest extends TestCase
99
{
1010
public function testExcludeAllEnv()
1111
{
12+
$_ENV['TEST_EXCLUDE_ENV'] = 'TEST';
13+
1214
$config = new Config([
13-
'profiler.is-exclude-all-env' => true
15+
'profiler.is-exclude-all-env' => true,
1416
]);
1517
$profilingData = new ProfilingData($config);
1618

@@ -21,5 +23,20 @@ public function testExcludeAllEnv()
2123
$this->assertEmpty($result['meta']['env']);
2224
}
2325

26+
public function testNotExcludeAllEnv()
27+
{
28+
$_ENV['TEST_EXCLUDE_ENV'] = 'TEST';
29+
30+
$config = new Config([
31+
'profiler.is-exclude-all-env' => false,
32+
]);
33+
$profilingData = new ProfilingData($config);
34+
35+
$profile = ['example' => 'data'];
36+
$result = $profilingData->getProfilingData($profile);
37+
38+
$this->assertEquals('TEST', $result['meta']['env']['TEST_EXCLUDE_ENV']);
39+
}
40+
2441

2542
}

0 commit comments

Comments
 (0)