Fix: Address CoreTest PHPUnit compatibility and remaining PHPCS issues
This commit is contained in:
@@ -43,14 +43,15 @@ class Admin {
|
|||||||
*
|
*
|
||||||
* @param string $hook_suffix The current admin page.
|
* @param string $hook_suffix The current admin page.
|
||||||
* @phpcs:ignore WordPress.CodeAnalysis.UnusedFunctionParameter.Found
|
* @phpcs:ignore WordPress.CodeAnalysis.UnusedFunctionParameter.Found
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public function enqueue_admin_assets( $hook_suffix ) {
|
public function enqueue_admin_assets( $hook_suffix ) {
|
||||||
// Enqueue admin styles.
|
// Enqueue admin styles.
|
||||||
\wp_enqueue_style(
|
\wp_enqueue_style(
|
||||||
'wpst-admin-style',
|
'wpst-admin-style',
|
||||||
'path/to/admin/css/admin-styles.css',
|
'path/to/admin/css/admin-styles.css',
|
||||||
array(), // Dependencies
|
array(), // Dependencies.
|
||||||
$this->core->get_plugin_version() // Version
|
$this->core->get_plugin_version() // Version.
|
||||||
);
|
);
|
||||||
|
|
||||||
// Enqueue admin scripts.
|
// Enqueue admin scripts.
|
||||||
@@ -58,7 +59,7 @@ class Admin {
|
|||||||
'wpst-admin-script',
|
'wpst-admin-script',
|
||||||
'path/to/admin/js/admin-scripts.js',
|
'path/to/admin/js/admin-scripts.js',
|
||||||
array( 'jquery' ),
|
array( 'jquery' ),
|
||||||
$this->core->get_plugin_version(), // Version
|
$this->core->get_plugin_version(), // Version.
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,10 @@ class CoreTest extends \WP_Mock\Tools\TestCase {
|
|||||||
private $core;
|
private $core;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up test environment
|
* Set up the test environment.
|
||||||
*/
|
*/
|
||||||
public function setUp() {
|
public function setUp(): void
|
||||||
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
// Set up mocks
|
// Set up mocks
|
||||||
@@ -33,9 +34,10 @@ class CoreTest extends \WP_Mock\Tools\TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tear down test environment
|
* Tear down the test environment.
|
||||||
*/
|
*/
|
||||||
public function tearDown() {
|
public function tearDown(): void
|
||||||
|
{
|
||||||
WP_Mock::tearDown();
|
WP_Mock::tearDown();
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user