Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a minimum supported WordPress version check with WPCompat #138

Merged
merged 1 commit into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ These are the steps to take to release a new version of User Switching (for cont
1. Check [the milestone on GitHub](https://github.com/johnbillion/user-switching/milestones) for open issues or PRs. Fix or reassign as necessary.
1. If this is a non-patch release, check issues and PRs assigned to the patch or minor milestones that will get skipped. Reassign as necessary.
1. Ensure you're on the `develop` branch and all the changes for this release have been merged in.
1. Ensure `readme.md` contains up to date descriptions, "Tested up to" versions, FAQs, screenshots, etc.
1. Ensure `phpstan.neon.dist` and `readme.md` contain up to date "Tested up to" versions, descriptions, FAQs, screenshots, etc.
1. Ensure `.gitattributes` is up to date with all files that shouldn't be part of the build.
- To do this, run `git archive --output=user-switching.zip HEAD` then check the contents for files that shouldn't be part of the package.
1. Run `composer test` and ensure everything passes.
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
"codeception/module-webdriver": "^1.0",
"codeception/util-universalframework": "^1.0",
"johnbillion/plugin-infrastructure": "dev-trunk",
"johnbillion/wp-compat": "0.1.0",
"lucatume/wp-browser": "3.2.3",
"phpcompatibility/phpcompatibility-wp": "2.1.5",
"phpstan/phpstan": "1.11.8",
"phpstan/phpstan": "1.12.2",
"phpstan/phpstan-phpunit": "1.4.0",
"roots/wordpress-core-installer": "1.100.0",
"roots/wordpress-full": "*",
Expand Down Expand Up @@ -83,7 +84,7 @@
],
"test:phpstan": [
"codecept build",
"phpstan analyze --memory-limit=1024M"
"phpstan analyze -v --memory-limit=1024M"
],
"test:start": [
"tests-start"
Expand Down
3 changes: 3 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/szepeviktor/phpstan-wordpress/extension.neon
- vendor/johnbillion/plugin-infrastructure/phpstan/extension.neon
- vendor/johnbillion/wp-compat/extension.neon
parameters:
level: 9
paths:
Expand All @@ -22,3 +23,5 @@ parameters:
message: '#^Unreachable statement#'
path: user-switching.php
count: 3
WPCompat:
requiresAtLeast: '5.8'
4 changes: 3 additions & 1 deletion tests/integration/PluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ private function get_readme(): ?array {

$file_contents = implode( '', $file_array );

preg_match( '|Stable tag:(.*)|i', $file_contents, $_stable_tag );
if ( preg_match( '|Stable tag:(.*)|i', $file_contents, $_stable_tag ) !== 1 ) {
return null;
}

$this->readme_data = array(
'stable_tag' => trim( trim( $_stable_tag[1], '*' ) )
Expand Down