Skip to content

Commit

Permalink
Merge pull request #620 from bugsnag/test-tweaks
Browse files Browse the repository at this point in the history
Disable XDebug on CI and register default callbacks in PHPT tests
  • Loading branch information
imjoehaines authored Jan 26, 2021
2 parents 5a62ea2 + 4468e96 commit bc1d445
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none

- run: composer validate

Expand Down
6 changes: 5 additions & 1 deletion tests/phpt/_prelude.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@

$guzzle = new FakeGuzzle();

return new Client(
$client = new Client(
$config,
null,
$guzzle
);

$client->registerDefaultCallbacks();

return $client;
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $handler->exceptionHandler(new LogicException('terrible things'));
--EXPECTF--
array(1) {
[0]=>
object(Exception)#15 (7) {
object(Exception)#%d (7) {
["message":protected]=>
string(10) "bad things"
["string":"Exception":private]=>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ throw new RuntimeException('abc xyz');
var_dump('I should not be reached');
?>
--EXPECTF--
object(RuntimeException)#15 (7) {
object(RuntimeException)#%d (7) {
["message":protected]=>
string(7) "abc xyz"
["string":"Exception":private]=>
Expand Down
2 changes: 1 addition & 1 deletion tests/phpt/handler_should_handle_all_throwables.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if (PHP_MAJOR_VERSION < 7) {
}
?>
--EXPECTF--
object(DivisionByZeroError)#15 (7) {
object(DivisionByZeroError)#%d (7) {
["message":protected]=>
string(12) "22 / 0 = ???"
["string":"Error":private]=>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (PHP_MAJOR_VERSION < 7) {
}
?>
--EXPECTF--
object(DivisionByZeroError)#15 (7) {
object(DivisionByZeroError)#%d (7) {
["message":protected]=>
string(12) "22 / 0 = ???"
["string":"Error":private]=>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ throw new RuntimeException('abc xyz');
var_dump('I should not be reached');
?>
--EXPECTF--
object(RuntimeException)#15 (7) {
object(RuntimeException)#%d (7) {
["message":protected]=>
string(7) "abc xyz"
["string":"Exception":private]=>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ throw new RuntimeException('abc xyz');
var_dump('I should not be reached');
?>
--EXPECTF--
object(RuntimeException)#15 (7) {
object(RuntimeException)#%d (7) {
["message":protected]=>
string(7) "abc xyz"
["string":"Exception":private]=>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (PHP_MAJOR_VERSION < 7) {
}
?>
--EXPECTF--
object(RuntimeException)#15 (7) {
object(RuntimeException)#%d (7) {
["message":protected]=>
string(7) "abc xyz"
["string":"Exception":private]=>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (PHP_MAJOR_VERSION !== 7) {
}
?>
--EXPECTF--
object(ParseError)#15 (7) {
object(ParseError)#%d (7) {
["message":protected]=>
string(28) "syntax error, unexpected '{'"
["string":"Error":private]=>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (PHP_MAJOR_VERSION !== 8) {
}
?>
--EXPECTF--
object(ParseError)#15 (7) {
object(ParseError)#%d (7) {
["message":protected]=>
string(34) "syntax error, unexpected token "}""
["string":"Error":private]=>
Expand Down

0 comments on commit bc1d445

Please sign in to comment.