Skip to content

Commit 84c1d5d

Browse files
authored
Merge pull request #91 from octalmage/whitelist-updates
Whitelist updates.
2 parents 0080765 + c3c23f4 commit 84c1d5d

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

src/wpephpcompat.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ class WPEPHPCompat {
7575
'*/tablepress/*' => '7.0',
7676
'*/myMail/*' => '7.0',
7777
'*/wp-spamshield/*' => '7.0',
78+
'*/vendor/stripe/stripe-php/lib/StripeObject.php' => '7.0', // https://github.com/wpengine/phpcompat/issues/89
79+
'*/gravityforms/*' => '7.0', // https://github.com/wpengine/phpcompat/issues/85
80+
'*/download-monitor/*' => '7.0', // https://github.com/wpengine/phpcompat/issues/84
81+
'*/query-monitor/*' => '7.0', // https://wordpress.org/support/topic/false-positive-showing-query-monitor-as-not-php-7-compatible/
82+
'*/bbpress/*' => '7.0', // https://wordpress.org/support/topic/false-positive-showing-bbpress-as-not-php-7-compatible/
83+
'*/comet-cache/*' => '7.0', // https://wordpress.org/support/topic/false-positive-comet-cache/
84+
'*/comment-mail/*' => '7.0', // https://wordpress.org/support/topic/false-positive-comment-mail/
85+
'*/social-networks-auto-poster-facebook-twitter-g/*' => '7.0', // https://wordpress.org/plugins/social-networks-auto-poster-facebook-twitter-g/
86+
'*/mailpoet/*' => '7.0', // https://wordpress.org/support/topic/false-positive-mailpoet-3-not-compatible-with-php7/
7887
);
7988

8089
/**
@@ -293,7 +302,7 @@ public function generate_ignored_list() {
293302
}
294303
}
295304

296-
return $ignored;
305+
return apply_filters( 'phpcompat_whitelist', $ignored );
297306
}
298307

299308
/**

tests/phpunit/test_generate_ignored_list.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,14 @@ function test_generate_ignored_list_version_55() {
7070
$this->assertNotContains( '*/fakeplugin/*', $ignored );
7171
$this->assertNotContains( '*/oldplugin/*', $ignored );
7272
}
73+
74+
function test_filter_ignored_list() {
75+
tests_add_filter( 'phpcompat_whitelist', function( $whitelist ) {
76+
return array_merge( $whitelist, array( '*/filterplugin/*') );
77+
} );
78+
79+
$ignored = $this->wpephpc->generate_ignored_list();
80+
81+
$this->assertContains( '*/filterplugin/*', $ignored );
82+
}
7383
}

tests/phpunit/test_scan.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
class TestScan extends WP_UnitTestCase {
33

44
function test_scan_default_PHP_55() {
5-
$expected_results = "Name: Twenty Sixteen
6-
7-
PHP 5.5 compatible.
8-
9-
";
105
$root_dir = realpath( __DIR__ . '/../../' );
116

127
$wpephpc = new \WPEPHPCompat( $root_dir );
@@ -19,15 +14,10 @@ function test_scan_default_PHP_55() {
1914

2015
$results = $wpephpc->start_test();
2116

22-
$this->assertEquals( $expected_results, $results );
17+
$this->assertContains( 'PHP 5.5 compatible.', $results );
2318
}
2419

2520
function test_scan_default_PHP_70() {
26-
$expected_results = "Name: Twenty Sixteen
27-
28-
PHP 7.0 compatible.
29-
30-
";
3121
$root_dir = realpath( __DIR__ . '/../../' );
3222

3323
$wpephpc = new \WPEPHPCompat( $root_dir );
@@ -40,6 +30,6 @@ function test_scan_default_PHP_70() {
4030

4131
$results = $wpephpc->start_test();
4232

43-
$this->assertEquals( $expected_results, $results );
33+
$this->assertContains( 'PHP 7.0 compatible.', $results );
4434
}
4535
}

0 commit comments

Comments
 (0)