Fix remaining CI/CD issues
- Add yoast/phpunit-polyfills ^2.0 to composer.json for WordPress test suite compatibility - Define WP_TESTS_PHPUNIT_POLYFILLS_PATH in bootstrap.php before loading WP test framework - Update actions/cache to v4 (deprecated SHA references cause failures) - Update actions/setup-java to v4 - Update codacy/codacy-analysis-cli-action to v4 tag (SHA ref not found) - Update github/codeql-action/upload-sarif to v3
This commit is contained in:
@@ -10,6 +10,11 @@ require_once dirname( dirname( __DIR__ ) ) . '/vendor/autoload.php';
|
||||
|
||||
// Check if we're running the WordPress tests
|
||||
if ( getenv( 'WP_PHPUNIT__DIR' ) ) {
|
||||
// Define PHPUnit Polyfills path for WordPress test suite.
|
||||
if ( ! defined( 'WP_TESTS_PHPUNIT_POLYFILLS_PATH' ) ) {
|
||||
define( 'WP_TESTS_PHPUNIT_POLYFILLS_PATH', dirname( dirname( __DIR__ ) ) . '/vendor/yoast/phpunit-polyfills/' );
|
||||
}
|
||||
|
||||
// Give access to tests_add_filter() function.
|
||||
require_once getenv( 'WP_PHPUNIT__DIR' ) . '/includes/functions.php';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user