diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 9550231..f503e8c 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: composer-flags: ["--prefer-stable", "--prefer-lowest"] - php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2'] + php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.4'] exclude: - {php-versions: '8.1', composer-flags: "--prefer-lowest"} - {php-versions: '8.2', composer-flags: "--prefer-lowest"} diff --git a/tests/BacktraceFactoryTest.php b/tests/BacktraceFactoryTest.php index 180a472..b1787bb 100644 --- a/tests/BacktraceFactoryTest.php +++ b/tests/BacktraceFactoryTest.php @@ -40,7 +40,12 @@ public function it_correctly_formats_annonymous_functions() $backtrace = (new BacktraceFactory($e, new Config))->trace(); } - $this->assertEquals('Honeybadger\Tests\{closure}', $backtrace[0]['method']); + // if php version is 8.4.0 or higher, then we need to check for a more specific closure name + if (version_compare(PHP_VERSION, '8.4.0', '>=')) { + $this->assertEquals('{closure:Honeybadger\Tests\BacktraceFactoryTest::it_correctly_formats_annonymous_functions():33}', $backtrace[0]['method']); + } else { + $this->assertEquals('Honeybadger\Tests\{closure}', $backtrace[0]['method']); + } $this->assertEquals(['bar'], $backtrace[0]['args']); } @@ -153,7 +158,12 @@ public function args_with_object_should_be_literals() $backtrace = (new BacktraceFactory($e, new Config))->trace(); } - $this->assertEquals('Honeybadger\Tests\{closure}', $backtrace[0]['method']); + // if php version is 8.4.0 or higher, then we need to check for a more specific closure name + if (version_compare(PHP_VERSION, '8.4.0', '>=')) { + $this->assertEquals('{closure:Honeybadger\Tests\BacktraceFactoryTest::args_with_object_should_be_literals():151}', $backtrace[0]['method']); + } else { + $this->assertEquals('Honeybadger\Tests\{closure}', $backtrace[0]['method']); + } $this->assertEquals(['bar', '[LITERAL]Object('.TestClass::class.')'], $backtrace[0]['args']); } }