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 25e8ca7 commit 44b61d9
Show file tree
Hide file tree
Showing 3 changed files with 2,089 additions and 627 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,20 +106,8 @@ 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 ${{ matrix.multisite && 'multisite' || 'single site' }} unit tests
run: npm run test-php${{ matrix.multisite && '-multisite' || '' }}
Loading

0 comments on commit 44b61d9

Please sign in to comment.