Fix: Resolve CI PHPCS and PHPUnit errors (attempt 3)

- Correct docblock spacing and remove trailing whitespace in Admin class.
- Restore wp_create_nonce mock in AdminTest, required by tested method.
This commit is contained in:
2025-04-18 20:06:08 +01:00
parent e9139ec9d9
commit 07d0e7e44b
2 changed files with 10 additions and 1 deletions

View File

@@ -109,6 +109,15 @@ class AdminTest extends \WP_Mock\Tools\TestCase {
'return' => $expected_data['ajax_url'],
]
);
// We need to mock wp_create_nonce as it's called directly in the method
\WP_Mock::userFunction(
'wp_create_nonce',
[
'times' => 1,
'args' => [ 'wpst_admin_nonce' ], // Match the action string used in class-admin.php
'return' => $expected_data['nonce'],
]
);
\WP_Mock::userFunction(
'wp_localize_script',
[