diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index ea65594f..dd92186f 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -7,6 +7,9 @@ on: jobs: test: + env: + WP_TESTS_DIR: /wordpress-files-tests + WP_CORE_DIR: /wordpress-files runs-on: ubuntu-latest services: mysql: @@ -44,7 +47,7 @@ jobs: done - name: Create Test Environment - run: bin/install-wp-tests.sh wordpress_test root 'rootpassword' 127.0.0.1 latest + run: bin/install-wp-tests.sh wordpress_test root 'rootpassword' localhost latest - name: Run PHPUnit tests run: vendor/bin/phpunit --configuration phpunit.xml.dist \ No newline at end of file diff --git a/bin/install-wp-tests.sh b/bin/install-wp-tests.sh index 9fd75eb7..ee05775c 100755 --- a/bin/install-wp-tests.sh +++ b/bin/install-wp-tests.sh @@ -14,8 +14,8 @@ SKIP_DB_CREATE=${6-false} TMPDIR=${TMPDIR-/tmp} TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//") -WP_TESTS_DIR=./wordpress-files -WP_CORE_DIR=./wordpress-files +WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib} +WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress} download() { if [ `which curl` ]; then diff --git a/composer.json b/composer.json index 48c5c43d..6dec1cc9 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,7 @@ } }, "scripts": { + "test-setup":"bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest", "version-update":"bash update_version.sh", "production": [ "composer validate",