Skip to content

Commit

Permalink
Fixed StackTraceUtilTest
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyKleyman committed Jan 13, 2025
1 parent 1ff3ded commit 3af4114
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/ElasticApmTests/Util/AssertMessageStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
final class AssertMessageStack implements LoggableInterface
{
/** @var bool */
private static $isEnabled = true;
private static $isEnabled = false;

/** @var ?AssertMessageStack */
private static $singleton = null;
Expand Down
3 changes: 2 additions & 1 deletion tests/ElasticApmTests/Util/StackTraceFrameExpectations.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ public static function fromClosure(string $fileName, int $lineNumber, ?string $n
if (PHP_VERSION_ID < 80400) {
$result = self::fromClassMethodUnknownLocation($class, $isStatic, ($namespace === null ? '' : ($namespace . '\\')) . '{closure}');
} else {
$result = self::fromClassMethodUnknownLocation($class, $isStatic, '{closure:' . $class . '::__METHOD__():__LINE__}');
$result = self::fromClassMethodUnknownLocation($class, $isStatic, '{closure:__CLASS__::__METHOD__():__LINE__}');
$expectedFunc = $result->function->getValue();
TestCaseBase::assertNotNull($expectedFunc);
$expectedFuncRegex = self::convertFunctionNameToRegPattern($expectedFunc);
$expectedFuncRegex = str_replace('__CLASS__', '[a-zA-Z0-9\\\\]+', $expectedFuncRegex);
$expectedFuncRegex = str_replace('__METHOD__', '[a-zA-Z0-9]+', $expectedFuncRegex);
$expectedFuncRegex = str_replace('__LINE__', '[0-9]+', $expectedFuncRegex);
$result->function->setValue($expectedFuncRegex);
Expand Down

0 comments on commit 3af4114

Please sign in to comment.