Skip to content

Commit 746a401

Browse files
committed
Fix tests
1 parent 4b8c7f2 commit 746a401

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

loader/tests/functional/includes/assert.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ function assertTelemetry($telemetryLogPath, $metrics) {
9494
EOS;
9595

9696
$lines = file($telemetryLogPath);
97-
assertEquals(count($lines), count($metrics), count($metrics)." metrics were expected, but got ".count($lines));
98-
9997
foreach ($lines as $line) {
10098
$matched = false;
10199
$pretty = json_encode(json_decode($line, true), JSON_PRETTY_PRINT);

loader/tests/functional/includes/autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require_once __DIR__.'/assert.php';
44

5-
set_exception_handler(function (\Throwable $ex) {
5+
set_exception_handler(function ($ex) {
66
$trace = $ex->getTrace();
77
$file = $trace[0]['file'] ?: '';
88
$line = $trace[0]['line'] ?: '';

loader/tests/functional/test_telemetry_error.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,16 @@
5151
"name": "library_entrypoint.error",
5252
"tags": [
5353
"error_type:so_not_found",
54-
"product:datadog-profiling"
54+
"product:ddappsec"
5555
]
5656
}
5757
]
5858
}
5959
EOS
60-
,
61-
<<<EOS
60+
];
61+
62+
if ('7.0' !== php_minor_version()) {
63+
$metrics[] = <<<EOS
6264
{
6365
"metadata": {
6466
"runtime_name": "php",
@@ -73,11 +75,12 @@
7375
"name": "library_entrypoint.error",
7476
"tags": [
7577
"error_type:so_not_found",
76-
"product:ddappsec"
78+
"product:datadog-profiling"
7779
]
7880
}
7981
]
8082
}
81-
EOS
82-
];
83+
EOS;
84+
}
85+
8386
assertTelemetry($telemetryLogPath, $metrics);

loader/tests/functional/test_telemetry_php5.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
{
2828
"name": "library_entrypoint.abort",
2929
"tags": [
30-
"reason:eol_runtime"
30+
"reason:eol_runtime",
31+
"product:NA"
3132
]
3233
},
3334
{

0 commit comments

Comments
 (0)