Skip to content

Commit

Permalink
Add custom exception handler and update dependencies
Browse files Browse the repository at this point in the history
Added a custom exception handler in a new autoload file under the tests directory. The PHPUnit bootstrap configuration was updated to use the new autoload file. Also, the dependency 'matthiasnoback/symfony-config-test' was switched to a 'dev-phpunit-11' version and the source repository for this dependency was added under the 'repositories' section in composer.json.
  • Loading branch information
Spomky committed Jun 16, 2024
1 parent 3c9b0aa commit 8573890
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"ekino/phpstan-banned-code": "^1.0",
"ergebnis/phpunit-slow-test-detector": "^2.14",
"infection/infection": "^0.28|^0.29",
"matthiasnoback/symfony-config-test": "^5.0",
"matthiasnoback/symfony-config-test": "dev-phpunit-11",
"paragonie/sodium_compat": "^1.20|^2.0",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpbench/phpbench": "^1.2",
Expand Down Expand Up @@ -118,5 +118,11 @@
"php-http/discovery": true,
"infection/extension-installer": false
}
},
"repositories": {
"wickedOne_SymfonyConfigTest": {
"type": "vcs",
"url": "[email protected]:wickedOne/SymfonyConfigTest.git"
}
}
}
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
backupGlobals="false"
processIsolation="false"
stopOnFailure="false"
bootstrap="vendor/autoload.php"
bootstrap="tests/autoload.php"
beStrictAboutTestsThatDoNotTestAnything="false"
colors="true"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
Expand Down
9 changes: 9 additions & 0 deletions tests/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

use Symfony\Component\ErrorHandler\ErrorHandler;

require dirname(__DIR__).'/vendor/autoload.php';

set_exception_handler([new ErrorHandler(), 'handleException']);

0 comments on commit 8573890

Please sign in to comment.