-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into add-experimental-admin-option
- Loading branch information
Showing
6 changed files
with
82 additions
and
19 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
tests/behat/testdata/pcp-addon/Example_Experimental_Check.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
use WordPress\Plugin_Check\Checker\Check_Result; | ||
use WordPress\Plugin_Check\Checker\Checks\Abstract_File_Check; | ||
use WordPress\Plugin_Check\Traits\Amend_Check_Result; | ||
use WordPress\Plugin_Check\Traits\Experimental_Check; | ||
|
||
class Example_Experimental_Check extends Abstract_File_Check { | ||
|
||
use Amend_Check_Result; | ||
use Experimental_Check; | ||
|
||
public function get_categories() { | ||
return array( 'new_category' ); | ||
} | ||
|
||
protected function check_files( Check_Result $result, array $files ) { | ||
$php_files = self::filter_files_by_extension( $files, 'php' ); | ||
$file = self::file_preg_match( '#experimental#', $php_files ); | ||
if ( $file ) { | ||
$this->add_result_error_for_file( | ||
$result, | ||
__( 'Experimental text found.', 'pcp-addon' ), | ||
'experimental_text_detected', | ||
$file, | ||
0, | ||
0, | ||
'', | ||
7 | ||
); | ||
} | ||
} | ||
|
||
public function get_description(): string { | ||
return ''; | ||
} | ||
|
||
public function get_documentation_url(): string { | ||
return ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters