22
33namespace Yoast \WP \Duplicate_Post \Tests \WP ;
44
5+ use WP_Error ;
56use Yoast \WP \Duplicate_Post \Post_Duplicator ;
67use Yoast \WPTestUtils \WPIntegration \TestCase ;
78
@@ -84,11 +85,11 @@ public function test_create_duplicate_for_rewrite_and_republish_blocks_duplicate
8485
8586 $ second_result = $ this ->instance ->create_duplicate_for_rewrite_and_republish ( $ post );
8687
87- $ this ->assertInstanceOf ( \ WP_Error::class, $ second_result );
88+ $ this ->assertInstanceOf ( WP_Error::class, $ second_result );
8889 $ this ->assertSame ( 'duplicate_post_already_has_copy ' , $ second_result ->get_error_code () );
8990
9091 // Original should still reference the first copy only.
91- $ meta_values = \get_post_meta ( $ post ->ID , '_dp_has_rewrite_republish_copy ' );
92+ $ meta_values = \get_post_meta ( $ post ->ID , '_dp_has_rewrite_republish_copy ' , false );
9293 $ this ->assertCount ( 1 , $ meta_values );
9394 $ this ->assertSame ( (string ) $ first_copy_id , $ meta_values [0 ] );
9495 }
@@ -113,7 +114,7 @@ public function test_create_duplicate_for_rewrite_and_republish_rolls_back_on_fa
113114
114115 \remove_filter ( 'wp_insert_post_empty_content ' , '__return_true ' );
115116
116- $ this ->assertInstanceOf ( \ WP_Error::class, $ result );
117+ $ this ->assertInstanceOf ( WP_Error::class, $ result );
117118
118119 // The claim should have been rolled back.
119120 $ this ->assertSame ( '' , \get_post_meta ( $ post ->ID , '_dp_has_rewrite_republish_copy ' , true ) );
0 commit comments