Skip to content

Commit cd55ec6

Browse files
committed
test: update to support 7.4+
Signed-off-by: Tom Carrio <[email protected]>
1 parent a95d7fc commit cd55ec6

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

hooks/OpenTelemetry/tests/integration/OpenTelemetryHookTest.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use OpenFeature\OpenFeatureAPI;
1010
use OpenFeature\interfaces\hooks\Hook;
1111

12+
use function phpversion;
13+
use function preg_match;
14+
1215
class OpenTelemetryHookTest extends TestCase
1316
{
1417
public function testIsRegisteredAutomatically(): void
@@ -21,7 +24,8 @@ public function testIsRegisteredAutomatically(): void
2124
$this->simulateAutoload();
2225

2326
// Then
24-
$this->assertNotEmpty($api->getHooks());
27+
28+
$this->assertCount($this->isAutoloadSupported() ? 1 : 0, $api->getHooks());
2529
$this->assertInstanceOf(Hook::class, $api->getHooks()[0]);
2630
}
2731

@@ -43,4 +47,15 @@ private function simulateAutoload(): void
4347
{
4448
require_once __DIR__ . '/../../src/_autoload.php';
4549
}
50+
51+
private function isAutoloadSupported(): bool
52+
{
53+
$version = phpversion();
54+
55+
if (!$version) {
56+
return false;
57+
}
58+
59+
return preg_match('/8\..+/', $version) === 1;
60+
}
4661
}

0 commit comments

Comments
 (0)