Skip to content

Commit

Permalink
ci: add 8.4 to test matrix and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
subzero10 committed Dec 7, 2024
1 parent 0d5a631 commit 0fc53d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
14 changes: 12 additions & 2 deletions tests/BacktraceFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}

Expand Down Expand Up @@ -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']);
}
}
Expand Down

0 comments on commit 0fc53d6

Please sign in to comment.