Skip to content
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
7 changes: 2 additions & 5 deletions phpcs-rulesets/plugin-check.ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,7 @@
<severity>7</severity>
</rule>

<!-- Check for discouraged load_plugin_textdomain() call. -->
<rule ref="PluginCheck.CodeAnalysis.DiscouragedFunctions.load_plugin_textdomainFound">
<type>error</type>
<severity>7</severity>
</rule>
<!-- Check for discouraged functions. -->
<rule ref="PluginCheck.CodeAnalysis.DiscouragedFunctions"/>

</ruleset>
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ public function test_run_with_errors() {
// There should not be WordPress.WP.AlternativeFunctions.file_system_operations_file_put_contents error on Line no 39 and column no 1.
$this->assertCount( 0, wp_list_filter( $errors['load.php'][39][1], array( 'code' => 'WordPress.WP.AlternativeFunctions.file_system_operations_file_put_contents' ) ) );

// Check for PluginCheck.CodeAnalysis.DiscouragedFunctions.load_plugin_textdomainFound error on Line no 41 and column no at 1.
$this->assertSame( 'PluginCheck.CodeAnalysis.DiscouragedFunctions.load_plugin_textdomainFound', $errors['load.php'][41][1][0]['code'] );

// Check for existing forbidden functions.
$forbidden_found = 'Generic.PHP.ForbiddenFunctions.Found';

Expand Down Expand Up @@ -113,6 +110,9 @@ public function test_run_with_errors() {
// Check for WordPress.WP.DiscouragedFunctions.wp_reset_query_wp_reset_query warning on Line no 26 and column no at 1.
$this->assertSame( 'WordPress.WP.DiscouragedFunctions.wp_reset_query_wp_reset_query', $warnings['load.php'][26][1][0]['code'] );

// Check for PluginCheck.CodeAnalysis.DiscouragedFunctions.load_plugin_textdomainFound warning on Line no 41 and column no at 1.
$this->assertSame( 'PluginCheck.CodeAnalysis.DiscouragedFunctions.load_plugin_textdomainFound', $warnings['load.php'][41][1][0]['code'] );

// Check for new forbidden functions
// Check for Generic.PHP.ForbiddenFunctions._cleanup_header_commentFound error on Line no 52 and column no at 1.
$this->assertSame( $forbidden_found, $errors['load.php'][52][1][0]['code'] );
Expand Down
Loading