Skip to content

Commit

Permalink
Move install-wp-tests.sh under phpunit dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaemnnosttv committed Jul 21, 2022
1 parent 75c47fc commit 1c8f558
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php-tests-wp-4-7-php-5-6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ jobs:
extensions: mysqli, runkit, uopz
php-version: '5.6'
- name: Set up PHP test data
run: tests/bin/install-wp-tests.sh ${MYSQL_DATABASE} ${MYSQL_USER} ${MYSQL_PASSWORD} ${DB_HOST}:${DB_PORT} ${WP_VERSION}
run: tests/phpunit/bin/install-wp-tests.sh ${MYSQL_DATABASE} ${MYSQL_USER} ${MYSQL_PASSWORD} ${DB_HOST}:${DB_PORT} ${WP_VERSION}
- name: Run Unit Tests
run: composer test -- --verbose
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ jobs:
- name: Composer Install
run: composer install --no-interaction --no-progress
- name: Set up PHP test data
run: tests/bin/install-wp-tests.sh ${MYSQL_DATABASE} ${MYSQL_USER} ${MYSQL_PASSWORD} ${DB_HOST}:${DB_PORT} ${WP_VERSION}
run: tests/phpunit/bin/install-wp-tests.sh ${MYSQL_DATABASE} ${MYSQL_USER} ${MYSQL_PASSWORD} ${DB_HOST}:${DB_PORT} ${WP_VERSION}
- name: Run Unit Tests
run: composer test:multisite -- --verbose
2 changes: 1 addition & 1 deletion .github/workflows/php-tests-wp-latest-php-7-4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ jobs:
- name: Composer Install
run: composer install --no-interaction --no-progress
- name: Set up PHP test data
run: tests/bin/install-wp-tests.sh ${MYSQL_DATABASE} ${MYSQL_USER} ${MYSQL_PASSWORD} ${DB_HOST}:${DB_PORT} ${WP_VERSION}
run: tests/phpunit/bin/install-wp-tests.sh ${MYSQL_DATABASE} ${MYSQL_USER} ${MYSQL_PASSWORD} ${DB_HOST}:${DB_PORT} ${WP_VERSION}
- name: Run Unit Tests
run: composer test -- --verbose
2 changes: 1 addition & 1 deletion .github/workflows/php-tests-wp-latest-php-8-0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ jobs:
- name: Update PHPUnit
run: composer update phpunit/phpunit --with-dependencies --ignore-platform-reqs --no-scripts
- name: Set up PHP test data
run: tests/bin/install-wp-tests.sh ${MYSQL_DATABASE} ${MYSQL_USER} ${MYSQL_PASSWORD} ${DB_HOST}:${DB_PORT} ${WP_VERSION}
run: tests/phpunit/bin/install-wp-tests.sh ${MYSQL_DATABASE} ${MYSQL_USER} ${MYSQL_PASSWORD} ${DB_HOST}:${DB_PORT} ${WP_VERSION}
- name: Run Unit Tests
run: composer test -- --verbose
2 changes: 1 addition & 1 deletion .github/workflows/php-tests-wp-nightly-php-7-4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ jobs:
- name: Composer Install
run: composer install --no-interaction --no-progress
- name: Set up PHP test data
run: tests/bin/install-wp-tests.sh ${MYSQL_DATABASE} ${MYSQL_USER} ${MYSQL_PASSWORD} ${DB_HOST}:${DB_PORT} ${WP_VERSION}
run: tests/phpunit/bin/install-wp-tests.sh ${MYSQL_DATABASE} ${MYSQL_USER} ${MYSQL_PASSWORD} ${DB_HOST}:${DB_PORT} ${WP_VERSION}
- name: Run Unit Tests
run: composer test -- --verbose
6 changes: 3 additions & 3 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ All commands listed below should be run from the root of the repository in your
```
1. Install WordPress and the WP Unit Test lib using the `install-wp-tests.sh` script
```
$ tests/bin/install-wp-tests.sh <db-name> <db-user> <db-pass> [db-host] [wp-version] [skip-database-creation]
$ tests/phpunit/bin/install-wp-tests.sh <db-name> <db-user> <db-pass> [db-host] [wp-version] [skip-database-creation]
```
### Example Usage
Install the test library and latest WordPress with a new database, using root credentials
```
$ tests/bin/install-wp-tests.sh googlesitekit_tests root password
$ tests/phpunit/bin/install-wp-tests.sh googlesitekit_tests root password
```
If you don't have `mysqladmin` installed on your host, you'll need to create a database manually and set `skip-database-creation` to `true`.
If you're not sure, run `which mysqladmin` which will output the path to the executable if installed, or nothing if not installed.
```
$ tests/bin/install-wp-tests.sh googlesitekit_tests root password localhost latest true
$ tests/phpunit/bin/install-wp-tests.sh googlesitekit_tests root password localhost latest true
```
**Important**: The `<db-name>` database will be created if it doesn't exist and all data will be removed during testing.
Expand Down
File renamed without changes.

0 comments on commit 1c8f558

Please sign in to comment.