File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -51,4 +51,16 @@ public function test_render_option_not_selected(): void {
51
51
52
52
$ this ->assertEquals ( '<option value="1" >Test</option> ' , $ this ->test ->render_option ( 1 , 2 ) );
53
53
}
54
+
55
+ public function test_render_options () {
56
+ $ post = \Mockery::mock ( 'WP_Post ' );
57
+ $ post ->ID = 42 ;
58
+
59
+ Functions \expect ( 'get_posts ' )->once ()->andReturn ( array ( $ post ) );
60
+ Functions \expect ( 'get_post_stati ' )->once ()->andReturn ( array ( 'pending ' , 'draft ' , 'future ' ) );
61
+ Functions \expect ( 'selected ' )->once ()->andReturn ( 'selected="selected" ' );
62
+ Functions \expect ( 'get_the_title ' )->once ()->andReturn ( 'A random title ' );
63
+
64
+ $ this ->assertEquals ( '<option value="42" selected="selected">A random title</option> ' , $ this ->test ->render_options ( 'post ' , 42 ) );
65
+ }
54
66
}
You can’t perform that action at this time.
0 commit comments