From 8c8af01258edcdb68044fd81f32ab37a1b698d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Fri, 20 Sep 2024 22:08:20 +0200 Subject: [PATCH] test --- .woodpecker/test.yml | 1 + composer.json | 3 ++- tests/bootstrap.php | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml index f6fd676..5b4b66c 100644 --- a/.woodpecker/test.yml +++ b/.woodpecker/test.yml @@ -11,6 +11,7 @@ steps: - apt-get -yqqf install zip unzip subversion - docker-php-ext-enable mbstring mysqli intl gd zip - bash bin/install-wp-tests.sh wordpress_tests root mysql mysql latest true + - composer install - phpunit --configuration phpunit.xml.dist diff --git a/composer.json b/composer.json index 945c004..23bfd77 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,8 @@ "squizlabs/php_codesniffer": "3.*", "wp-coding-standards/wpcs": "dev-develop", "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", - "sirbrillig/phpcs-variable-analysis": "^2.11" + "sirbrillig/phpcs-variable-analysis": "^2.11", + "yoast/phpunit-polyfill": "*" }, "config": { "allow-plugins": true diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 72f381a..57aadd2 100755 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -11,6 +11,8 @@ if ( ! $_tests_dir ) { $_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib'; } +require dirname( dirname( __FILE__ ) ) . '/vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php'; + // Forward custom PHPUnit Polyfills configuration to PHPUnit bootstrap file. $_phpunit_polyfills_path = getenv( 'WP_TESTS_PHPUNIT_POLYFILLS_PATH' ); if ( false !== $_phpunit_polyfills_path ) {