Skip to content

Commit 0c5c2e9

Browse files
authored
Merge pull request #206 from wp-cli/fix/205-polyfills
Support `yoast/phpunit-polyfills`
2 parents 3cab4c5 + 80ef437 commit 0c5c2e9

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ composer.lock
1111
phpunit.xml
1212
phpcs.xml
1313
.phpcs.xml
14+
.phpunit.result.cache

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"wp-cli/eval-command": "^1 || ^2",
2121
"wp-cli/wp-cli": "^2.5.1",
2222
"wp-coding-standards/wpcs": "^3",
23-
"yoast/phpunit-polyfills": "^1.0.3"
23+
"yoast/phpunit-polyfills": "^1.0.3 || ^2.0.1"
2424
},
2525
"require-dev": {
2626
"roave/security-advisories": "dev-latest"

phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
>
55
<testsuites>
66
<testsuite name="default">
7-
<directory prefix="spec-" suffix=".php">tests/</directory>
8-
<directory prefix="test-" suffix=".php">tests/</directory>
7+
<directory prefix="Spec" suffix=".php">tests/</directory>
8+
<directory prefix="Test" suffix=".php">tests/tests</directory>
99
</testsuite>
1010
</testsuites>
1111
</phpunit>

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
require_once VENDOR_DIR . '/autoload.php';
3131
require_once WP_CLI_ROOT . '/php/utils.php';
32-
require_once __DIR__ . '/wp-cli-testcase.php';
32+
require_once __DIR__ . '/includes/TestCase.php';
3333

3434
function wpcli_tests_include_config( array $config_filenames = [] ) {
3535
$config_filename = false;
File renamed without changes.

tests/test-behat-tags.php renamed to tests/tests/TestBehatTags.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use WP_CLI\Tests\TestCase;
44
use WP_CLI\Utils;
55

6-
class BehatTagsTest extends TestCase {
6+
class TestBehatTags extends TestCase {
77

88
public $temp_dir;
99

@@ -39,7 +39,7 @@ public function test_behat_tags_wp_version_github_token( $env, $expected ) {
3939
putenv( 'WP_VERSION' );
4040
putenv( 'GITHUB_TOKEN' );
4141

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

4444
$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';
4545
file_put_contents( $this->temp_dir . '/features/wp_version.feature', $contents );
@@ -64,7 +64,7 @@ public function test_behat_tags_wp_version_github_token( $env, $expected ) {
6464
putenv( false === $env_github_token ? 'GITHUB_TOKEN' : "GITHUB_TOKEN=$env_github_token" );
6565
}
6666

67-
public function data_behat_tags_wp_version_github_token() {
67+
public static function data_behat_tags_wp_version_github_token() {
6868
return array(
6969
array( 'WP_VERSION=4.5', '[email protected]&&[email protected]&&[email protected]&&~@github-api' ),
7070
array( 'WP_VERSION=4.6', '[email protected]&&[email protected]&&[email protected]&&~@github-api' ),
@@ -85,7 +85,7 @@ public function test_behat_tags_php_version() {
8585

8686
putenv( 'GITHUB_TOKEN' );
8787

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

9090
$php_version = substr( PHP_VERSION, 0, 3 );
9191
$contents = '';
@@ -142,7 +142,7 @@ public function test_behat_tags_extension() {
142142

143143
putenv( 'GITHUB_TOKEN' );
144144

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

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

0 commit comments

Comments
 (0)