-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cmsp-679] PHP 8.3 compatibility checks (#135)
* add some local test helpers * let's see where the tests dir lives on ci * try another thing maybe? * add a new local phpunit install script and use that * use the right option * nocache isn't an option for composer... * remove the wp dir paths we don't need them if we're setting TMPDIR * update the message about where we're installing tests * use newer versions of phpcompatibility for php8 checks * add php8 check and add to lint script * run the php8-check lint in php8.2 tests the tests run composer phpcs but not composer lint. lint combines phpcs and php8-check so we'll run the php8-check manually * add new tests for 8.3 * use dev-develop rather than dev-master * trash all that and use the GH action * restore line break that i inadvertently removed * just remove the 8.2 tests we don't really need to test both things * update comment * run a phplint composer lint is not run, only phpcs, and that's run in a non-php-specific environment, so splitting it out into a separate script and composer lint runs both * run the phplint script in both the 7.4 and 8.3 tests * allow any install-wp-tests parameter to be passed in
- Loading branch information
1 parent
73142f5
commit fa93b95
Showing
4 changed files
with
88 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Initialize variables with default values | ||
TMPDIR="/tmp" | ||
DB_NAME="wordpress_test" | ||
DB_USER="root" | ||
DB_PASS="" | ||
DB_HOST="127.0.0.1" | ||
WP_VERSION="latest" | ||
SKIP_DB="" | ||
|
||
# Display usage information | ||
usage() { | ||
echo "Usage:" | ||
echo "./install-local-tests.sh [--dbname=wordpress_test] [--dbuser=root] [--dbpass=''] [--dbhost=127.0.0.1] [--wpversion=latest] [--no-db]" | ||
} | ||
|
||
# Parse command-line arguments | ||
for i in "$@" | ||
do | ||
case $i in | ||
--dbname=*) | ||
DB_NAME="${i#*=}" | ||
shift | ||
;; | ||
--dbuser=*) | ||
DB_USER="${i#*=}" | ||
shift | ||
;; | ||
--dbpass=*) | ||
DB_PASS="${i#*=}" | ||
shift | ||
;; | ||
--dbhost=*) | ||
DB_HOST="${i#*=}" | ||
shift | ||
;; | ||
--wpversion=*) | ||
WP_VERSION="${i#*=}" | ||
shift | ||
;; | ||
--no-db) | ||
SKIP_DB="true" | ||
shift | ||
;; | ||
*) | ||
# unknown option | ||
usage | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
# Run install-wp-tests.sh | ||
echo "Installing local tests into ${TMPDIR}" | ||
bash "$(dirname "$0")/install-wp-tests.sh" "$DB_NAME" "$DB_USER" "$DB_PASS" "$DB_HOST" "$WP_VERSION" "$SKIP_DB" | ||
|
||
# Run PHPUnit | ||
echo "Running PHPUnit" | ||
composer phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.