Closed nateweller closed 1 year ago
Why not return a valid MySQL version as in db_version()
?
Why not return a valid MySQL version as in
db_version()
?
This seems more appropriate since WorDBless is already in the practice of mocking a specific database environment. Most of the use cases for db_server_info()
is for handling special cases surrounding MariaDB, so I don't see any potential issues.
Thank you.
This PR adds a mock method to override
$wpdb->db_server_info()
indbless-wpdb.php
.The purpose of this is to allow graceful execution of
dbDelta()
in WorDBless test cases.Currently, the
dbDelta
function calls$wpdb->db_server_info()
, which will end up callingmysql_get_server_info()
, which fatals. The reasonsmysql_get_server_info
breaks will either be due to the fact that it was removed in PHP 7.0.0, or if you're running an earlier version of PHP, because the method expects$wpdb->dbh
to not befalse
ornull
.Would this be a useful addition? While this doesn't necessarily add support for using
dbDelta
in WorDBless, it does prevent it from breaking when the function is executed inside a WorDBless test case.