mitoteam / jpgraph

JpGraph library composer package with PHP 8.3 support
https://packagist.org/packages/mitoteam/jpgraph
Other
32 stars 4 forks source link

Phpunit 11 and Exception Handlers #18

Open oleibman opened 1 month ago

oleibman commented 1 month ago

PhpSpreadsheet is not moving towards Phpunit 11 any time soon. I just wanted to do a little preliminary investigation. At the conclusion of one of our unit tests, I see the following:

There was 1 risky test:

1) PhpOffice\PhpSpreadsheetTests\Chart\ChartsDynamicTitleTest::testDynamicTitle
* Test code or tested code did not remove its own error handlers

* Test code or tested code did not remove its own exception handlers

After putting in some debugging information, I see that there is no problem with error handlers. But, exception handler is null at the beginning of our test, and at the end it is:

C:\git\phpunit11\tests\PhpSpreadsheetTests\Chart\ChartsDynamicTitleTest.php:149:
array(2) {
  [0] =>
  string(16) "JpGraphException"
  [1] =>
  string(14) "defaultHandler"
}

Is there anything you can do to restore the previous exception handler when your work is done? No need for a quick answer; just want you to start thinking about it.

oleibman commented 1 month ago

It appears that "run in separate process" eliminates the "risky" assessment. So probably nothing else need be done. But it's worth thinking about anyhow.