silverstripe-framework/tests/php
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
..
Control Merge branch '4.12' into 4.13 2023-04-26 11:44:54 +12:00
Core FIX Reduce array method calls 2023-03-22 11:06:23 +13:00
Dev ENH Improve deprecation logging 2023-03-06 13:25:44 +13:00
Forms Merge pull request #9976 from kinglozzer/9975-default-form-action 2023-05-09 21:45:24 +12:00
i18n Merge pull request #10577 from creative-commoners/pulls/4/textcollector-class-notation 2022-11-25 10:27:59 +13:00
Logging ENH Improve deprecation logging 2023-03-06 13:25:44 +13:00
ORM FIX PHP 8.1 support in MySQLiConnector::query errors (#10570) 2023-07-07 15:56:31 +12:00
Security Merge branch '4.12' into 4 2022-11-23 16:42:25 +13:00
View API Deprecate Diff in favour of CMS5's HtmlDiff 2023-02-08 11:15:28 +13:00