silverstripe-framework/tests
Dylan Wagstaff 8c3ba81052
FIX PHP 8.1 support in MySQLiConnector::query errors (#10570)
* FIX PHP 8.1 support in MySQLiConnector::query errors

The default error reporting mode in PHP 8.1 has changed from using
errors reported on the connection handle to throwing
mysqli_sql_exception. query() makes no allowance for this, and
functions up the call stack expect to catch
Silverstripe\ORM\Connect\DatabaseException instead - resulting in the
MySQLi exception going all the way up to halt the system.

We can use a try, catch, and finally to retain backwards compatibility,
no matter which setting (e.g. PHP version default) someone has enabled.

* Move MySQLConnector test skip call into setUp()

As review feedback; marking the test as skipped in a private function
obfuscated where the call was happening and made it harder to skimread
the tests. Moving this into a setUp function makes it obvious the check
is run before each test case, and skipped if necessary.
2023-07-07 15:56:31 +12:00
..
behat MNT Don't use deprecated jQuery size() function in behat (#10524) 2022-10-06 14:40:57 +13:00
bootstrap ENH PHP 8.1 compatibility 2022-04-14 13:12:59 +12:00
php FIX PHP 8.1 support in MySQLiConnector::query errors (#10570) 2023-07-07 15:56:31 +12:00
bootstrap.php API Refactor bootstrap, request handling 2017-06-22 22:50:45 +12:00
dump_constants.php ENHANCEMENT Log user constants during CI for debugging improvements 2017-08-23 14:23:33 +12:00
phpcs_runner.php ENH PHP 8.1 compatibility 2022-04-14 13:12:59 +12:00