Skip to content

Commit 5c15434

Browse files
committed
Contd work
1 parent 3cf1ac7 commit 5c15434

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

tests/php/FieldmanagerContextSubmenuTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class FieldmanagerContextSubmenuTest extends WP_UnitTestCase {
1212

1313
public function set_up() {
1414
parent::set_up();
15+
16+
require_once ABSPATH . '/wp-admin/includes/template.php';
17+
1518
add_filter( 'fm_submenu_presave_data', array( $this, 'presave_alter_number' ), 10, 2 );
1619
}
1720

tests/php/FieldmanagerScriptLoadingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static function script_data() {
7171
}
7272

7373
#[DataProvider('script_data')]
74-
function test_script_is_registered( $handle ) {
74+
function test_script_is_registered( $handle, $deps ) {
7575
global $wp_scripts;
7676
$this->assertInstanceOf( '_WP_Dependency', $wp_scripts->query( $handle ) );
7777
}

tests/php/Includes/FieldmanagerAssetsUnitTestCase.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
<?php
2+
3+
use Mantle\Testing\Concerns\Admin_Screen;
4+
25
/**
36
* Base UnitTestCase for Fieldmanager script and style testing.
47
*/
58
class FieldmanagerAssetsUnitTestCase extends WP_UnitTestCase {
9+
use Admin_Screen;
610

711
protected $screen, $old_wp_scripts;
812

@@ -23,6 +27,8 @@ public function set_up() {
2327
Fieldmanager_Field::$enqueued_base_assets = false;
2428
Fieldmanager_Media::$has_registered_media = false;
2529
Fieldmanager_Util_Assets::instance()->hooked = false;
30+
31+
require_once ABSPATH . '/wp-admin/includes/template.php';
2632
}
2733

2834
public function tear_down() {

0 commit comments

Comments
 (0)