mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
This aims to bring some consistency to the location of the tests for this class. Includes adding the missing `@covers` tags. Follow-up to [36177], [51622], [54250]. Props pbearne, SergeyBiryukov. See #56793, #56782. git-svn-id: https://develop.svn.wordpress.org/trunk@54710 602fd350-edb4-49c9-b593-d223f7449a82
39 lines
711 B
PHP
39 lines
711 B
PHP
<?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 ) );
|
|
}
|
|
}
|