diff --git tests/phpunit/tests/wp/sendHeaders.php tests/phpunit/tests/wp/sendHeaders.php
index b5fc56bf20..928aa6a85d 100644
|
|
|
class Tests_WP_SendHeaders extends WP_UnitTestCase { |
| 35 | 35 | $post_id = self::factory()->post->create(); |
| 36 | 36 | $this->go_to( get_permalink( $post_id ) ); |
| 37 | 37 | } |
| | 38 | |
| | 39 | /** |
| | 40 | * @ticket 61711 |
| | 41 | */ |
| | 42 | public function test_send_headers_sets_cache_control_header_for_password_protected_posts() { |
| | 43 | add_action( |
| | 44 | 'wp_headers', |
| | 45 | function ( $headers ) { |
| | 46 | $this->assertArrayHasKey( 'Cache-Control', $headers ); |
| | 47 | } |
| | 48 | ); |
| | 49 | |
| | 50 | $post_id = self::factory()->post->create(); |
| | 51 | add_filter( 'post_password_required', '__return_true' ); |
| | 52 | $this->go_to( get_permalink( $post_id ) ); |
| | 53 | remove_filter( 'post_password_required', '__return_true' ); |
| | 54 | } |
| 38 | 55 | } |