Skip to content

Commit

Permalink
Update to wp-env 10.6.0 and thus remove previously required workaround.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixarntz committed Sep 3, 2024
1 parent d1ed224 commit 7ca5a92
Show file tree
Hide file tree
Showing 3 changed files with 185 additions and 64 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/php-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,9 @@ jobs:
- name: npm install
run: npm ci

- name: Patch @wordpress/env for WordPress versions 5.0 and older
run: sed -i -e "s/--anchor=\"define( 'WP_DEBUG',\"/--anchor=\"define('WP_DEBUG',\"/" node_modules/@wordpress/env/lib/wordpress.js
if: startsWith(matrix.wordpress, '4.') || startsWith(matrix.wordpress, '5.0')

- name: Install WordPress
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 -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 -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
run: npm run test-php

Expand Down
Loading

0 comments on commit 7ca5a92

Please sign in to comment.