File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ protected function setUp(): void {
26
26
Functions \when ( 'esc_url ' )->returnArg ();
27
27
Functions \when ( '__ ' )->returnArg ();
28
28
Functions \when ( 'wp_kses ' )->returnArg ();
29
+ Functions \when ( 'sanitize_text_field ' )->returnArg ();
29
30
}
30
31
31
32
Original file line number Diff line number Diff line change @@ -61,7 +61,16 @@ public function test_init(): void {
61
61
* Verify the static suggest-method
62
62
*/
63
63
public function test_suggest (): void {
64
+ $ term = \Mockery::mock ( \WP_Term::class );
65
+ $ term ->term_id = 42 ;
66
+ $ term ->name = 'test ' ;
67
+
64
68
Functions \expect ( 'wp_die ' );
69
+ Functions \expect ( 'filter_has_var ' )->atLeast ()->once ()->andReturnTrue ();
70
+ Functions \expect ( 'filter_input ' )->atLeast ()->once ()->andReturn ( 'suggest_terms ' );
71
+ Functions \expect ( 'switch_to_blog ' )->atLeast ()->once ();
72
+ Functions \expect ( 'restore_current_blog ' )->atLeast ()->once ();
73
+ Functions \expect ( 'get_terms ' )->atLeast ()->once ()->andReturn ( array ( $ term ) );
65
74
66
75
self ::expectOutputString ( '' );
67
76
You can’t perform that action at this time.
0 commit comments