Fix code quality issues
- Added periods to inline comments - Removed else clause for better code readability - Added proper sanitization for with wp_unslash - Added PHPCS ignore comment with explanation - Updated tests to mock wp_unslash function
This commit is contained in:
@@ -78,6 +78,12 @@ class AdminTest extends \WP_Mock\Tools\TestCase {
|
||||
// Set up the superglobal for the test
|
||||
$_GET['page'] = 'wp_plugin_starter_template_settings';
|
||||
|
||||
// Mock wp_unslash function
|
||||
WP_Mock::userFunction('wp_unslash', [
|
||||
'args' => ['wp_plugin_starter_template_settings'],
|
||||
'return' => 'wp_plugin_starter_template_settings',
|
||||
]);
|
||||
|
||||
// Mock WordPress functions used in the method
|
||||
WP_Mock::userFunction('plugin_dir_url', [
|
||||
'return' => 'http://example.com/wp-content/plugins/wp-plugin-starter-template/includes/Admin/',
|
||||
|
||||
Reference in New Issue
Block a user