From 819e8aa29429830fbd0a96f0581cdde40cf0ceaa Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Mon, 13 Nov 2023 09:44:16 -0600 Subject: [PATCH] Update ReplacementCallbacksTests.php --- .../tests/integration/ReplacementCallbacksTests.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/faustwp/tests/integration/ReplacementCallbacksTests.php b/plugins/faustwp/tests/integration/ReplacementCallbacksTests.php index dca393c04..5569b4e3c 100644 --- a/plugins/faustwp/tests/integration/ReplacementCallbacksTests.php +++ b/plugins/faustwp/tests/integration/ReplacementCallbacksTests.php @@ -166,7 +166,7 @@ public function test_post_link_returns_filtered_link_when_content_replacement_is */ public function test_post_preview_link_returns_filtered_link() { faustwp_update_setting( 'frontend_uri', 'http://moo' ); - faustwp_update_setting( 'enable_redirects', true ); + $this->assertSame( 'http://moo/?p=' . $this->post_id . '&preview=true&previewPathname=' . rawurlencode( wp_make_link_relative( get_permalink( $this->post_id ) ) ) . '&typeName=Post', get_preview_post_link( $this->post_id ) ); } @@ -175,7 +175,7 @@ public function test_post_preview_link_returns_filtered_link() { */ public function test_post_preview_link_adds_preview_true_query_param() { faustwp_update_setting( 'frontend_uri', 'http://moo' ); - faustwp_update_setting( 'enable_redirects', true ); + $link = post_preview_link( 'http://moo/', get_post( $this->post_id ) ); $this->assertSame( 'http://moo/?previewPathname=' . rawurlencode( wp_make_link_relative( get_permalink( $this->post_id ) ) ) . '&p=' . $this->post_id . '&preview=true&typeName=Post', $link ); @@ -190,15 +190,13 @@ public function test_post_preview_doesnt_rewrite_link_with_redirect_off() { $link = post_preview_link( 'http://moo/', get_post( $this->post_id ) ); $this->assertSame( 'http://moo/', $link ); - - faustwp_update_setting( 'enable_redirects', true ); } /** * Tests post_preview_link() uses frontend_uri scheme if different than home_url scheme. */ public function test_post_preview_link_uses_frontend_uri_scheme() { - faustwp_update_setting( 'enable_redirects', true ); + faustwp_update_setting( 'frontend_uri', 'http://moo' ); add_filter( 'home_url', [$this, 'get_home_url'] ); $link = post_preview_link( 'http://moo/', get_post( $this->post_id ) );