From 75887ec8655f03af4c61d88a2da346eaebf74fd6 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 21 Oct 2015 16:14:06 +0000 Subject: [PATCH] Document title tests should expect dynamic blogname. Fixes #31078. git-svn-id: https://develop.svn.wordpress.org/trunk@35329 602fd350-edb4-49c9-b593-d223f7449a82 --- .../phpunit/tests/general/document-title.php | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/phpunit/tests/general/document-title.php b/tests/phpunit/tests/general/document-title.php index 79145b2320..807ac777ae 100644 --- a/tests/phpunit/tests/general/document-title.php +++ b/tests/phpunit/tests/general/document-title.php @@ -6,7 +6,7 @@ * @group template * @group document-title */ -class Tests_Document_Title extends WP_UnitTestCase { +class Tests_General_DocumentTitle extends WP_UnitTestCase { function setUp() { parent::setUp(); @@ -65,7 +65,7 @@ class Tests_Document_Title extends WP_UnitTestCase { $this->go_to( '/' ); - $this->expectOutputString( "front-page – Test Blog\n" ); + $this->expectOutputString( "front-page – " . get_option( 'blogname' ) . "\n" ); _wp_render_title_tag(); update_option( 'show_on_front', 'posts' ); @@ -76,7 +76,7 @@ class Tests_Document_Title extends WP_UnitTestCase { add_filter( 'document_title_parts', array( $this, '_home_title_parts' ) ); - $this->expectOutputString( "Test Blog – Just another WordPress site\n" ); + $this->expectOutputString( "" . get_option( 'blogname' ) . " – Just another WordPress site\n" ); _wp_render_title_tag(); } @@ -93,7 +93,7 @@ class Tests_Document_Title extends WP_UnitTestCase { add_filter( 'document_title_parts', array( $this, '_paged_title_parts' ) ); - $this->expectOutputString( "Test Blog – Page 4 – Just another WordPress site\n" ); + $this->expectOutputString( "" . get_option( 'blogname' ) . " – Page 4 – Just another WordPress site\n" ); _wp_render_title_tag(); } @@ -111,7 +111,7 @@ class Tests_Document_Title extends WP_UnitTestCase { add_filter( 'document_title_parts', array( $this, '_singular_title_parts' ) ); - $this->expectOutputString( "test_title – Test Blog\n" ); + $this->expectOutputString( "test_title – " . get_option( 'blogname' ) . "\n" ); _wp_render_title_tag(); } @@ -126,21 +126,21 @@ class Tests_Document_Title extends WP_UnitTestCase { function test_category_title() { $this->go_to( '?cat=' . $this->category_id ); - $this->expectOutputString( "test_category – Test Blog\n" ); + $this->expectOutputString( "test_category – " . get_option( 'blogname' ) . "\n" ); _wp_render_title_tag(); } function test_search_title() { $this->go_to( '?s=test_title' ); - $this->expectOutputString( "Search Results for “test_title” – Test Blog\n" ); + $this->expectOutputString( "Search Results for “test_title” – " . get_option( 'blogname' ) . "\n" ); _wp_render_title_tag(); } function test_author_title() { $this->go_to( '?author=' . $this->author_id ); - $this->expectOutputString( "test_author – Test Blog\n" ); + $this->expectOutputString( "test_author – " . get_option( 'blogname' ) . "\n" ); _wp_render_title_tag(); } @@ -159,35 +159,35 @@ class Tests_Document_Title extends WP_UnitTestCase { $this->go_to( '?post_type=cpt' ); - $this->expectOutputString( "test_cpt – Test Blog\n" ); + $this->expectOutputString( "test_cpt – " . get_option( 'blogname' ) . "\n" ); _wp_render_title_tag(); } function test_year_title() { $this->go_to( '?year=2015' ); - $this->expectOutputString( "2015 – Test Blog\n" ); + $this->expectOutputString( "2015 – " . get_option( 'blogname' ) . "\n" ); _wp_render_title_tag(); } function test_month_title() { $this->go_to( '?monthnum=09' ); - $this->expectOutputString( "September 2015 – Test Blog\n" ); + $this->expectOutputString( "September 2015 – " . get_option( 'blogname' ) . "\n" ); _wp_render_title_tag(); } function test_day_title() { $this->go_to( '?day=22' ); - $this->expectOutputString( "September 22, 2015 – Test Blog\n" ); + $this->expectOutputString( "September 22, 2015 – " . get_option( 'blogname' ) . "\n" ); _wp_render_title_tag(); } function test_404_title() { $this->go_to( '?m=404' ); - $this->expectOutputString( "Page not found – Test Blog\n" ); + $this->expectOutputString( "Page not found – " . get_option( 'blogname' ) . "\n" ); _wp_render_title_tag(); } @@ -196,7 +196,7 @@ class Tests_Document_Title extends WP_UnitTestCase { add_filter( 'title_tag_parts', array( $this, '_paged_post_title_parts' ) ); - $this->expectOutputString( "test_title – Page 4 – Test Blog\n" ); + $this->expectOutputString( "test_title – Page 4 – " . get_option( 'blogname' ) . "\n" ); _wp_render_title_tag(); } @@ -214,7 +214,7 @@ class Tests_Document_Title extends WP_UnitTestCase { add_filter( 'document_title_parts', array( $this, '_rearrange_title_parts' ) ); - $this->expectOutputString( "Test Blog – test_title\n" ); + $this->expectOutputString( "" . get_option( 'blogname' ) . " – test_title\n" ); _wp_render_title_tag(); } @@ -232,7 +232,7 @@ class Tests_Document_Title extends WP_UnitTestCase { add_filter( 'document_title_separator', array( $this, '_change_title_separator' ) ); - $this->expectOutputString( "test_title %% Test Blog\n" ); + $this->expectOutputString( "test_title %% " . get_option( 'blogname' ) . "\n" ); _wp_render_title_tag(); }