From 7f6907f0f95df4dfac87b2d1d9b56386b568b237 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Sat, 4 Nov 2023 21:38:31 -0700 Subject: [PATCH] Attempt to fix wp-env problems workaround. --- .github/workflows/php-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php-test.yml b/.github/workflows/php-test.yml index 93bf50c..c2e2098 100644 --- a/.github/workflows/php-test.yml +++ b/.github/workflows/php-test.yml @@ -91,11 +91,11 @@ jobs: run: npm run wp-env start - name: Fix wp-tests-config.php for WordPress versions 5.1-5.3 - run: npm run wp-env run tests-wordpress -- sh -c "sed -e \"/^require.*wp-settings.php/d\" -e \"s/define( 'ABSPATH', dirname( __FILE__ ) . '\\/' );/define( 'ABSPATH', '\\/var\\/www\\/html\\/' );\\n\\tdefine( 'WP_DEFAULT_THEME', 'default' );/\" /var/www/html/wp-config.php > /wordpress-phpunit/wp-tests-config.php" + run: npm run wp-env run tests-wordpress -- sh -c "sed -i -e \"s/define( 'ABSPATH', dirname( __FILE__ ) . '\\/' );/define( 'ABSPATH', '\\/var\\/www\\/html\\/' );\\n\\tdefine( 'WP_DEFAULT_THEME', 'default' );/\" /wordpress-phpunit/wp-tests-config.php" if: startsWith(matrix.wordpress, '5.') && !startsWith(matrix.wordpress, '5.0') - name: Fix wp-tests-config.php for WordPress versions 5.0 and older - run: npm run wp-env run tests-wordpress -- sh -c "sed -e \"/^require.*wp-settings.php/d\" -e \"s/define('ABSPATH', dirname(__FILE__) . '\\/');/define( 'ABSPATH', '\\/var\\/www\\/html\\/' );\\n\\tdefine( 'WP_DEFAULT_THEME', 'default' );/\" /var/www/html/wp-config.php > /wordpress-phpunit/wp-tests-config.php" + run: npm run wp-env run tests-wordpress -- sh -c "sed -i -e \"s/define('ABSPATH', dirname(__FILE__) . '\\/');/define( 'ABSPATH', '\\/var\\/www\\/html\\/' );\\n\\tdefine( 'WP_DEFAULT_THEME', 'default' );/\" /wordpress-phpunit/wp-tests-config.php" if: startsWith(matrix.wordpress, '4.') || startsWith(matrix.wordpress, '5.0') - name: Running PHPUnit tests