Ticket #44192: 44192.diff
File 44192.diff, 1.6 KB (added by , 7 years ago) |
---|
-
src/wp-includes/link-template.php
4329 4329 $privacy_policy_url = get_privacy_policy_url(); 4330 4330 4331 4331 if ( $privacy_policy_url ) { 4332 $link = sprintf( 4332 $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); 4333 $link = sprintf( 4333 4334 '<a class="privacy-policy-link" href="%s">%s</a>', 4334 4335 esc_url( $privacy_policy_url ), 4335 __( 'Privacy Policy')4336 get_the_title( $policy_page_id ) 4336 4337 ); 4337 4338 } 4338 4339 -
tests/phpunit/tests/link/getThePrivacyPolicyLink.php
71 71 72 72 /** 73 73 * The function should return a valid link if a privacy policy page has been 74 * created and set as the `wp_page_for_privacy_policy`. 74 * created and set as the `wp_page_for_privacy_policy`. The post title should 75 * be used as the link text. 75 76 */ 76 77 public function test_get_the_privacy_policy_link_should_return_valid_link_when_privacy_page_set() { 77 78 update_option( 'wp_page_for_privacy_policy', self::$privacy_policy_page_id ); … … 80 81 81 82 $this->assertStringStartsWith( '<a', $actual_link ); 82 83 $this->assertContains( self::$privacy_policy_url, $actual_link ); 84 $this->assertContains( '>' . WP_TESTS_DOMAIN . ' Privacy Policy</a>', $actual_link ); 83 85 $this->assertStringEndsWith( '</a>', $actual_link ); 84 86 } 85 87