Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 37e3b7b

Browse files
committed
Add unit-test for snapshot_merge_print_script
1 parent 3a1c5d5 commit 37e3b7b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/php/test-class-post-type.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,17 @@ public function test_handle_snapshot_bulk_actions() {
828828
* @see Post_Type::snapshot_merge_print_script()
829829
*/
830830
public function test_snapshot_merge_print_script() {
831-
$this->markTestIncomplete();
831+
global $post_type;
832+
$post_type = Post_Type::SLUG; // WPCS: global override ok.
833+
$post_type_obj = new Post_Type( $this->plugin->customize_snapshot_manager );
834+
ob_start();
835+
$post_type_obj->snapshot_merge_print_script();
836+
$metabox_content = ob_get_clean();
837+
838+
$this->assertContains( 'select[name="action"]', $metabox_content );
839+
$this->assertContains( 'select[name="action2"]', $metabox_content );
840+
$this->assertContains( 'merge_snapshot', $metabox_content );
841+
$this->assertContains( 'text/javascript', $metabox_content );
832842
}
833843

834844
/**

0 commit comments

Comments
 (0)