From b8ad5a18947f91f1817ed601daef1fb43a670b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 6 May 2026 19:33:13 +0300 Subject: [PATCH 1/2] Use traditional array syntax in ProfilingDataTest --- tests/ProfilingDataTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/ProfilingDataTest.php b/tests/ProfilingDataTest.php index ac0171f..5bb8f89 100644 --- a/tests/ProfilingDataTest.php +++ b/tests/ProfilingDataTest.php @@ -11,12 +11,12 @@ public function testExcludeAllEnv() { $_ENV['TEST_EXCLUDE_ENV'] = 'TEST'; - $config = new Config([ + $config = new Config(array( 'profiler.exclude-all-env' => true, - ]); + )); $profilingData = new ProfilingData($config); - $profile = ['example' => 'data']; + $profile = array('example' => 'data'); $result = $profilingData->getProfilingData($profile); $this->assertEmpty($result['meta']['env']); @@ -26,12 +26,12 @@ public function testNotExcludeAllEnv() { $_ENV['TEST_EXCLUDE_ENV'] = 'TEST'; - $config = new Config([ + $config = new Config(array( 'profiler.exclude-all-env' => false, - ]); + )); $profilingData = new ProfilingData($config); - $profile = ['example' => 'data']; + $profile = array('example' => 'data'); $result = $profilingData->getProfilingData($profile); $this->assertEquals('TEST', $result['meta']['env']['TEST_EXCLUDE_ENV']); From 12c00df8ffd4a09318372fbc3a42f15eaecbaf4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 6 May 2026 19:40:33 +0300 Subject: [PATCH 2/2] Init REQUEST_TIME_FLOAT for testExcludeAllEnv test --- tests/ProfilingDataTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/ProfilingDataTest.php b/tests/ProfilingDataTest.php index 5bb8f89..a08d93e 100644 --- a/tests/ProfilingDataTest.php +++ b/tests/ProfilingDataTest.php @@ -9,6 +9,12 @@ class ProfilingDataTest extends TestCase { public function testExcludeAllEnv() { + // 'REQUEST_TIME_FLOAT' isn't available before 5.4.0 + // https://www.php.net/manual/en/reserved.variables.server.php + if (!isset($_SERVER['REQUEST_TIME_FLOAT'])) { + $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); + } + $_ENV['TEST_EXCLUDE_ENV'] = 'TEST'; $config = new Config(array(