From 9c81db5b309681fb7448b20fc846a41aea2722be Mon Sep 17 00:00:00 2001 From: Esa-Matti Suuronen Date: Tue, 28 Dec 2021 09:39:16 +0200 Subject: [PATCH 1/8] Bind php version and use the new checkout --- .github/workflows/test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index de840fc..79e52cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,12 @@ jobs: options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + + - name: Use php 7.2 + uses: shivammathur/setup-php@v2 + with: + php-version: "7.2" - uses: actions/cache@v1 id: cache-composer From 3901393c64c3ca6b72e9605497e2601225352ddc Mon Sep 17 00:00:00 2001 From: Esa-Matti Suuronen Date: Tue, 28 Dec 2021 09:39:44 +0200 Subject: [PATCH 2/8] Use composer 2 --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 6f7b124..3c18449 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -21,7 +21,7 @@ RUN apt-get update \ ca-certificates \ mariadb-client -RUN curl -L https://github.com/composer/composer/releases/download/1.9.1/composer.phar -o /usr/local/bin/composer && chmod +x /usr/local/bin/composer +RUN curl -L https://github.com/composer/composer/releases/download/2.1.8/composer.phar -o /usr/local/bin/composer && chmod +x /usr/local/bin/composer ARG XDEBUG=/etc/php/7.2/cli/conf.d/20-xdebug.ini RUN echo "[XDebug]" >> ${XDEBUG} \ From c314f3910ef7b0adbbb033d58e467e7d0ca2500e Mon Sep 17 00:00:00 2001 From: Esa-Matti Suuronen Date: Tue, 28 Dec 2021 09:40:06 +0200 Subject: [PATCH 3/8] Autoload composer in tests --- tests/_data/config.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/_data/config.php b/tests/_data/config.php index 6ee34c0..883dbf4 100644 --- a/tests/_data/config.php +++ b/tests/_data/config.php @@ -1,3 +1,5 @@ Date: Tue, 28 Dec 2021 09:40:41 +0200 Subject: [PATCH 4/8] Test with the latest wp-graphql --- composer.wp-install.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.wp-install.json b/composer.wp-install.json index c17556a..64cbe9f 100644 --- a/composer.wp-install.json +++ b/composer.wp-install.json @@ -10,7 +10,7 @@ ], "require": { "composer/installers": "^1.0", - "wp-graphql/wp-graphql": "^0.8.4" + "wp-graphql/wp-graphql": "1.6.10" }, "extra": { "installer-paths": { From 01e2099b2977a5831a997ffd98b273c1d2664f65 Mon Sep 17 00:00:00 2001 From: Esa-Matti Suuronen Date: Tue, 28 Dec 2021 09:43:23 +0200 Subject: [PATCH 5/8] Bail out on invalid query args --- src/Loader.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Loader.php b/src/Loader.php index 3d5ad3c..202de1e 100644 --- a/src/Loader.php +++ b/src/Loader.php @@ -90,6 +90,11 @@ function op_filter_graphql_connection_query_args( $query_args, AbstractConnectionResolver $resolver ) { + + if (!is_array($query_args)) { + return $query_args; + } + $info = $resolver->getInfo(); $selection_set = $info->getFieldSelection(2); From 22befc05a831fb71cf2938ed0351cefc342d217e Mon Sep 17 00:00:00 2001 From: Esa-Matti Suuronen Date: Tue, 28 Dec 2021 09:52:36 +0200 Subject: [PATCH 6/8] Update wptt --- composer.json | 2 +- docker/init.sh | 8 ++++++++ docker/run | 12 ++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index fe6cdaf..b2bc03a 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require-dev": { - "valu/wp-testing-tools": "^0.4.0", + "valu/wp-testing-tools": "^0.6.0", "lucatume/wp-browser": "^2.2", "phpunit/phpunit": "^8.0", "codeception/module-asserts": "^1.0", diff --git a/docker/init.sh b/docker/init.sh index 777c054..7351e60 100755 --- a/docker/init.sh +++ b/docker/init.sh @@ -21,6 +21,14 @@ composer install composer wp-install +cat > $HOME/.my.cnf <&2 echo "WP is running at http://localhost:8080/ and run tests against it using 'docker/run shell'" diff --git a/docker/run b/docker/run index 46d4329..0f8691c 100755 --- a/docker/run +++ b/docker/run @@ -23,6 +23,9 @@ help() { Start the container without installing anything. Usefull for debugging or developing install steps + $cmd clean + Remove the installation directory and containers + " } @@ -78,6 +81,11 @@ update() { exit 5 } +clean() { + rm -rf "$WPTT_INSTALL_DIR" + compose rm +} + case "${1:-}" in -h|--help) help @@ -104,6 +112,10 @@ case "${1:-}" in shift update ;; + clean) + shift + clean + ;; *) >&2 echo "Bad action ${1:-}" exit 1 From c34726267b4ac1f1a339ff43559747e0cf4ceef6 Mon Sep 17 00:00:00 2001 From: Esa-Matti Suuronen Date: Tue, 28 Dec 2021 10:02:20 +0200 Subject: [PATCH 7/8] Export .env in docker/run --- docker/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/run b/docker/run index 0f8691c..5c32cb9 100755 --- a/docker/run +++ b/docker/run @@ -40,7 +40,7 @@ fi echo "# Generated file. Do not edit. Edit .env.docker instead" > .env echo "" >> .env cat .env.docker >> .env -eval $(grep -v '^#' .env) +export $(grep -v '^#' .env | xargs) shell() { From bdce62551e7d5a0f87be38e5b61565ab9116ca69 Mon Sep 17 00:00:00 2001 From: Esa-Matti Suuronen Date: Tue, 28 Dec 2021 10:07:25 +0200 Subject: [PATCH 8/8] Fix table prefix --- codeception.dist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codeception.dist.yml b/codeception.dist.yml index 522d1ff..25d0ff0 100644 --- a/codeception.dist.yml +++ b/codeception.dist.yml @@ -29,7 +29,7 @@ modules: dbHost: "%WPTT_DB_HOST%" dbUser: "%WPTT_DB_USER%" dbPassword: "%WPTT_DB_PASSWORD%" - tablePrefix: "_wp" + tablePrefix: "wp_" domain: "%WPTT_SITE_HOST%" adminEmail: "%WPTT_SITE_ADMIN_EMAIL%" title: "Test"