Tests: Use updated filter names and oembed title for UT sanity.
See [35294], #31078. git-svn-id: https://develop.svn.wordpress.org/trunk@35295 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d625bd2428
commit
c7a86be42c
|
@ -20,7 +20,7 @@ wp_enqueue_style( 'open-sans' );
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html <?php language_attributes(); ?>>
|
<html <?php language_attributes(); ?>>
|
||||||
<head>
|
<head>
|
||||||
<title><?php wp_title( '-', true, 'right' ); ?></title>
|
<title><?php echo wp_get_document_title(); ?></title>
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -48,7 +48,7 @@ class Tests_Document_Title extends WP_UnitTestCase {
|
||||||
function test_short_circuiting_title() {
|
function test_short_circuiting_title() {
|
||||||
$this->go_to( '/' );
|
$this->go_to( '/' );
|
||||||
|
|
||||||
add_filter( 'title_tag_pre', array( $this, '_short_circuit_title' ) );
|
add_filter( 'pre_get_document_title', array( $this, '_short_circuit_title' ) );
|
||||||
|
|
||||||
$this->expectOutputString( "<title>A Wild Title</title>\n" );
|
$this->expectOutputString( "<title>A Wild Title</title>\n" );
|
||||||
_wp_render_title_tag();
|
_wp_render_title_tag();
|
||||||
|
@ -74,7 +74,7 @@ class Tests_Document_Title extends WP_UnitTestCase {
|
||||||
function test_home_title() {
|
function test_home_title() {
|
||||||
$this->go_to( '/' );
|
$this->go_to( '/' );
|
||||||
|
|
||||||
add_filter( 'title_tag_parts', array( $this, '_home_title_parts' ) );
|
add_filter( 'document_title_parts', array( $this, '_home_title_parts' ) );
|
||||||
|
|
||||||
$this->expectOutputString( "<title>Test Blog – Just another WordPress site</title>\n" );
|
$this->expectOutputString( "<title>Test Blog – Just another WordPress site</title>\n" );
|
||||||
_wp_render_title_tag();
|
_wp_render_title_tag();
|
||||||
|
@ -91,7 +91,7 @@ class Tests_Document_Title extends WP_UnitTestCase {
|
||||||
function test_paged_title() {
|
function test_paged_title() {
|
||||||
$this->go_to( '?page=4' );
|
$this->go_to( '?page=4' );
|
||||||
|
|
||||||
add_filter( 'title_tag_parts', array( $this, '_paged_title_parts' ) );
|
add_filter( 'document_title_parts', array( $this, '_paged_title_parts' ) );
|
||||||
|
|
||||||
$this->expectOutputString( "<title>Test Blog – Page 4 – Just another WordPress site</title>\n" );
|
$this->expectOutputString( "<title>Test Blog – Page 4 – Just another WordPress site</title>\n" );
|
||||||
_wp_render_title_tag();
|
_wp_render_title_tag();
|
||||||
|
@ -109,7 +109,7 @@ class Tests_Document_Title extends WP_UnitTestCase {
|
||||||
function test_singular_title() {
|
function test_singular_title() {
|
||||||
$this->go_to( '?p=' . $this->post_id );
|
$this->go_to( '?p=' . $this->post_id );
|
||||||
|
|
||||||
add_filter( 'title_tag_parts', array( $this, '_singular_title_parts' ) );
|
add_filter( 'document_title_parts', array( $this, '_singular_title_parts' ) );
|
||||||
|
|
||||||
$this->expectOutputString( "<title>test_title – Test Blog</title>\n" );
|
$this->expectOutputString( "<title>test_title – Test Blog</title>\n" );
|
||||||
_wp_render_title_tag();
|
_wp_render_title_tag();
|
||||||
|
@ -212,7 +212,7 @@ class Tests_Document_Title extends WP_UnitTestCase {
|
||||||
function test_rearrange_title_parts() {
|
function test_rearrange_title_parts() {
|
||||||
$this->go_to( '?p=' . $this->post_id );
|
$this->go_to( '?p=' . $this->post_id );
|
||||||
|
|
||||||
add_filter( 'title_tag_parts', array( $this, '_rearrange_title_parts' ) );
|
add_filter( 'document_title_parts', array( $this, '_rearrange_title_parts' ) );
|
||||||
|
|
||||||
$this->expectOutputString( "<title>Test Blog – test_title</title>\n" );
|
$this->expectOutputString( "<title>Test Blog – test_title</title>\n" );
|
||||||
_wp_render_title_tag();
|
_wp_render_title_tag();
|
||||||
|
@ -230,7 +230,7 @@ class Tests_Document_Title extends WP_UnitTestCase {
|
||||||
function test_change_title_separator() {
|
function test_change_title_separator() {
|
||||||
$this->go_to( '?p=' . $this->post_id );
|
$this->go_to( '?p=' . $this->post_id );
|
||||||
|
|
||||||
add_filter( 'title_tag_separator', array( $this, '_change_title_separator' ) );
|
add_filter( 'document_title_separator', array( $this, '_change_title_separator' ) );
|
||||||
|
|
||||||
$this->expectOutputString( "<title>test_title %% Test Blog</title>\n" );
|
$this->expectOutputString( "<title>test_title %% Test Blog</title>\n" );
|
||||||
_wp_render_title_tag();
|
_wp_render_title_tag();
|
||||||
|
|
Loading…
Reference in New Issue