forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsendHeaders.php
More file actions
38 lines (33 loc) · 711 Bytes
/
sendHeaders.php
File metadata and controls
38 lines (33 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* @group wp
*
* @covers WP::send_headers
*/
class Tests_WP_SendHeaders extends WP_UnitTestCase {
/**
* @ticket 56068
*/
public function test_send_headers_runs_after_posts_have_been_queried() {
add_action(
'send_headers',
function ( $wp ) {
$this->assertQueryTrue( 'is_front_page', 'is_home' );
}
);
$this->go_to( home_url() );
}
/**
* @ticket 56840
*/
public function test_send_headers_sets_x_pingback_for_single_posts_that_allow_pings() {
add_action(
'wp_headers',
function ( $headers ) {
$this->assertArrayHasKey( 'X-Pingback', $headers );
}
);
$post_id = self::factory()->post->create();
$this->go_to( get_permalink( $post_id ) );
}
}