Conversation
aaemnnosttv
left a comment
There was a problem hiding this comment.
Hey thanks for the PR!
I'd be happy to merge it but I wanted to avoid requiring PHP 8 just yet and it turns out that doesn't seem to be necessary. See #97
Note that PR also updates the test matrix to run tests with PHP 8.5 👍
Do you want to update this one to match or do you want to update this to be a follow up with the db enhancement?
| * @Then /^the ([^\s]+) database should( not)? exist$/ | ||
| */ | ||
| public function theGivenDatabaseShouldNotExist($database_name, $should_not_exist = false) { | ||
| $mysql_binary = $this->variables['MYSQL_BINARY']; |
There was a problem hiding this comment.
This doesn't seem related to PHP 8.5 but happy to include it 👍
|
Thanks so much for reviewing, @aaemnnosttv! 😄 Having checked out #97, the tests fail under My theory being there's some small implementation differences in Your PR wouldn't be able to use I agree it would be better to not break compatibility in principle. I started out trying to do that but had so many roadblocks that I just couldn't. When I got fed up enough to set 8.0 as the platform version, everything got a lot easier! Would you instead be amenable to merging these changes under a If I may opine, it doesn't strike me as particularly likely that into 2026 many developers are using Laravel Valet to run 7.4 and install a new WP version. (Not saying people don't need to work on projects running a seven year old PHP version, but unlikely to be starting new projects under it). Either way, if you're feeling you'd prefer not to have 8.0 as a minimum version, perhaps I can figure something out. Thanks again. Update: Figured it out! It wasn't differences between |
|
I've pushed more commits with the goal of ensuring we don't have to bump the minimum required PHP version whilst also enabling the tests to run on macOS (more detail in prior comment). In order for the tests to succeed on macOS with Personally, I find this dissatisfactory. I apologise accordingly. I felt it'd be best to split this package into two major versions: The deprecation warnings that are thrown are necessary under these requirements. It's the only acceptable middle-ground I know of. |
Fixes #94.
This PR adds support for PHP 8.x versions by bumping dependency versions, and making some changes to tests so that they run under PHP 8.5 (latest stable).
Testing procedure
Tested with every minor 8.x version (8.0, 8.1, 8.2, 8.3, 8.4, and 8.5). Development and testing was done on 8.5.
Commands run on every version:
composer validate --strictcomposer installwp valet new <name>Commands run on 8.5:
composer behatTests pass:
PHP 8.5 notes
Because 8.5 is so recent, I needed to use the nightly build of WP-CLI to avoid (harmless) noise:
wp cli update --nightly(version:WP-CLI 2.13.0-alpha-b0f2aec).Additionally, one warning shown by
composer install(andupdate):roots/wp-password-bcryptis abandoned nowbcryptis in WP core as of 6.8. We need to just ignore that for the time being.Changes made to tests
I tried to run the tests under every minor PHP 8.x version but couldn't due to dependency issues. PHP 8.0 and 8.1 (both now EOL) couldn't run it at all, but I made sure
wp valet new <name>works on every 8.x version.For the Bedrock tests,
$_SERVERenv vars weren't returning and those tests failed. I fixed that by usinggetenv()instead.Due to being unfamiliar with SQLite, I got stuck here:I changed "run" to "try" to get it to pass, but it's imperfect.Onaaemnnosttv/wp-sqlite-dbsqliteCreateFunctionis currently used. There is a PR over there that fix. If you can merge that (first, ideally) I'll bump the version ofaaemnnosttv/wp-sqlite-dbused here and revert the test grammar.Thank you! I've bumped the version number accordingly and also reverted the test grammar. Text above can be disregarded.
Finally, I changed from a hardcoded
mysqlinfeatures/Context/FeatureContext.phpto aMYSQL_BINARYenv var instead. My dev setup uses mariadb and the tests intermittently failed otherwise. This PR onwp-cli/wp-cli-testswas useful.Major version bump?
Since these changes expressly require PHP 8.x or newer (
composer require php >=8.0), I was wondering if you think this release should be tagged version 2.x, or similar? Let me know if you want me to merge into a different branch accordingly.Thanks so much. 😄