Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support yoast/phpunit-polyfills v2 #206

Merged
merged 3 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ composer.lock
phpunit.xml
phpcs.xml
.phpcs.xml
.phpunit.result.cache
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"wp-cli/eval-command": "^1 || ^2",
"wp-cli/wp-cli": "^2.5.1",
"wp-coding-standards/wpcs": "^3",
"yoast/phpunit-polyfills": "^1.0.3"
"yoast/phpunit-polyfills": "^1.0.3 || ^2.0.1"
},
"require-dev": {
"roave/security-advisories": "dev-latest"
Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
>
<testsuites>
<testsuite name="default">
<directory prefix="spec-" suffix=".php">tests/</directory>
<directory prefix="test-" suffix=".php">tests/</directory>
<directory prefix="Spec" suffix=".php">tests/</directory>
<directory prefix="Test" suffix=".php">tests/tests</directory>
</testsuite>
</testsuites>
</phpunit>
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

require_once VENDOR_DIR . '/autoload.php';
require_once WP_CLI_ROOT . '/php/utils.php';
require_once __DIR__ . '/wp-cli-testcase.php';
require_once __DIR__ . '/includes/TestCase.php';

function wpcli_tests_include_config( array $config_filenames = [] ) {
$config_filename = false;
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions tests/test-behat-tags.php → tests/tests/TestBehatTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use WP_CLI\Tests\TestCase;
use WP_CLI\Utils;

class BehatTagsTest extends TestCase {
class TestBehatTags extends TestCase {

public $temp_dir;

Expand Down Expand Up @@ -39,7 +39,7 @@ public function test_behat_tags_wp_version_github_token( $env, $expected ) {
putenv( 'WP_VERSION' );
putenv( 'GITHUB_TOKEN' );

$behat_tags = dirname( __DIR__ ) . '/utils/behat-tags.php';
$behat_tags = dirname( dirname( __DIR__ ) ) . '/utils/behat-tags.php';

$contents = '@require-wp-4.6 @require-wp-4.8 @require-wp-4.9 @less-than-wp-4.6 @less-than-wp-4.8 @less-than-wp-4.9';
file_put_contents( $this->temp_dir . '/features/wp_version.feature', $contents );
Expand All @@ -64,7 +64,7 @@ public function test_behat_tags_wp_version_github_token( $env, $expected ) {
putenv( false === $env_github_token ? 'GITHUB_TOKEN' : "GITHUB_TOKEN=$env_github_token" );
}

public function data_behat_tags_wp_version_github_token() {
public static function data_behat_tags_wp_version_github_token() {
return array(
array( 'WP_VERSION=4.5', '~@require-wp-4.6&&~@require-wp-4.8&&~@require-wp-4.9&&~@github-api' ),
array( 'WP_VERSION=4.6', '~@require-wp-4.8&&~@require-wp-4.9&&~@less-than-wp-4.6&&~@github-api' ),
Expand All @@ -85,7 +85,7 @@ public function test_behat_tags_php_version() {

putenv( 'GITHUB_TOKEN' );

$behat_tags = dirname( __DIR__ ) . '/utils/behat-tags.php';
$behat_tags = dirname( dirname( __DIR__ ) ) . '/utils/behat-tags.php';

$php_version = substr( PHP_VERSION, 0, 3 );
$contents = '';
Expand Down Expand Up @@ -142,7 +142,7 @@ public function test_behat_tags_extension() {

putenv( 'GITHUB_TOKEN' );

$behat_tags = dirname( __DIR__ ) . '/utils/behat-tags.php';
$behat_tags = dirname( dirname( __DIR__ ) ) . '/utils/behat-tags.php';

file_put_contents( $this->temp_dir . '/features/extension.feature', '@require-extension-imagick @require-extension-curl' );

Expand Down