@@ -186,10 +186,10 @@ public function test_post_preview_link_adds_preview_true_query_param() {
186
186
*/
187
187
public function test_post_preview_doesnt_rewrite_link_with_redirect_off () {
188
188
faustwp_update_setting ( 'enable_redirects ' , false );
189
+ $ expected = 'http://moo/?p= ' . $ this ->post_id ;
190
+ $ link = post_preview_link ( $ expected , get_post ( $ this ->post_id ) );
189
191
190
- $ link = post_preview_link ( 'http://moo/ ' , get_post ( $ this ->post_id ) );
191
-
192
- $ this ->assertSame ( 'http://moo/ ' , $ link );
192
+ $ this ->assertSame ( $ expected , $ link );
193
193
194
194
faustwp_update_setting ( 'enable_redirects ' , true );
195
195
}
@@ -214,6 +214,7 @@ public function test_custom_post_type_post_preview_link_returns_filtered_link_wh
214
214
{
215
215
faustwp_update_setting ( 'frontend_uri ' , 'http://moo ' );
216
216
faustwp_update_setting ( 'enable_rewrites ' , true );
217
+ faustwp_update_setting ( 'enable_redirects ' , true );
217
218
$ post_id = $ this ->getCustomPostType ();
218
219
$ this ->assertSame ( 'http://moo/?document= ' . $ post_id . '&preview=true&previewPathname= ' . rawurlencode ( wp_make_link_relative ( get_permalink ( $ post_id ) ) ) . '&p= ' . $ post_id . '&typeName=Document ' , get_preview_post_link ( $ post_id ) );
219
220
faustwp_update_setting ( 'frontend_uri ' , null );
@@ -238,6 +239,7 @@ public function test_custom_post_type_post_link_returns_unfiltered_link_when_con
238
239
*/
239
240
public function test_post_preview_link_filters_link_for_posts_not_registered_with_wpgraphql () {
240
241
faustwp_update_setting ( 'frontend_uri ' , 'http://moo ' );
242
+ faustwp_update_setting ( 'enable_redirects ' , true );
241
243
242
244
register_post_type ('notgraphql ' , ['public ' => true ]);
243
245
0 commit comments