Skip to content

Commit

Permalink
Tests - disabled E_DEPRECATED from vendor code
Browse files Browse the repository at this point in the history
  • Loading branch information
tg666 committed Nov 23, 2023
1 parent c4c7003 commit 5b8c3f8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,15 @@
Environment::setup();
Environment::bypassFinals();

# disable E_DEPRECATED errors from the vendor code (some nette packages before v3.1 are not fully compatible with PHP 8.1/8.2)
$previousHandler = set_error_handler(static function (int $errNo, string $errStr, string $errFile, int $errLine) use (&$previousHandler): bool {
$vendor = realpath(__DIR__ . '/../vendor');

if (E_DEPRECATED === $errNo && 0 === strncmp($errFile, $vendor, strlen($vendor))) {
return true;
}

return $previousHandler($errNo, $errStr, $errFile, $errLine);
});

return $loader;

0 comments on commit 5b8c3f8

Please sign in to comment.