Make WordPress Core

Changeset 35329


Ignore:
Timestamp:
10/21/2015 04:14:06 PM (9 years ago)
Author:
boonebgorges
Message:

Document title tests should expect dynamic blogname.

Fixes #31078.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/general/document-title.php

    r35295 r35329  
    77 * @group document-title
    88 */
    9 class Tests_Document_Title extends WP_UnitTestCase {
     9class Tests_General_DocumentTitle extends WP_UnitTestCase {
    1010
    1111    function setUp() {
     
    6666        $this->go_to( '/' );
    6767
    68         $this->expectOutputString( "<title>front-page &#8211; Test Blog</title>\n" );
     68        $this->expectOutputString( "<title>front-page &#8211; " . get_option( 'blogname' ) . "</title>\n" );
    6969        _wp_render_title_tag();
    7070
     
    7777        add_filter( 'document_title_parts', array( $this, '_home_title_parts' ) );
    7878
    79         $this->expectOutputString( "<title>Test Blog &#8211; Just another WordPress site</title>\n" );
     79        $this->expectOutputString( "<title>" . get_option( 'blogname' ) . " &#8211; Just another WordPress site</title>\n" );
    8080        _wp_render_title_tag();
    8181    }
     
    9494        add_filter( 'document_title_parts', array( $this, '_paged_title_parts' ) );
    9595
    96         $this->expectOutputString( "<title>Test Blog &#8211; Page 4 &#8211; Just another WordPress site</title>\n" );
     96        $this->expectOutputString( "<title>" . get_option( 'blogname' ) . " &#8211; Page 4 &#8211; Just another WordPress site</title>\n" );
    9797        _wp_render_title_tag();
    9898    }
     
    112112        add_filter( 'document_title_parts', array( $this, '_singular_title_parts' ) );
    113113
    114         $this->expectOutputString( "<title>test_title &#8211; Test Blog</title>\n" );
     114        $this->expectOutputString( "<title>test_title &#8211; " . get_option( 'blogname' ) . "</title>\n" );
    115115        _wp_render_title_tag();
    116116    }
     
    127127        $this->go_to( '?cat=' . $this->category_id );
    128128
    129         $this->expectOutputString( "<title>test_category &#8211; Test Blog</title>\n" );
     129        $this->expectOutputString( "<title>test_category &#8211; " . get_option( 'blogname' ) . "</title>\n" );
    130130        _wp_render_title_tag();
    131131    }
     
    134134        $this->go_to( '?s=test_title' );
    135135
    136         $this->expectOutputString( "<title>Search Results for &#8220;test_title&#8221; &#8211; Test Blog</title>\n" );
     136        $this->expectOutputString( "<title>Search Results for &#8220;test_title&#8221; &#8211; " . get_option( 'blogname' ) . "</title>\n" );
    137137        _wp_render_title_tag();
    138138    }
     
    141141        $this->go_to( '?author=' . $this->author_id );
    142142
    143         $this->expectOutputString( "<title>test_author &#8211; Test Blog</title>\n" );
     143        $this->expectOutputString( "<title>test_author &#8211; " . get_option( 'blogname' ) . "</title>\n" );
    144144        _wp_render_title_tag();
    145145    }
     
    160160        $this->go_to( '?post_type=cpt' );
    161161
    162         $this->expectOutputString( "<title>test_cpt &#8211; Test Blog</title>\n" );
     162        $this->expectOutputString( "<title>test_cpt &#8211; " . get_option( 'blogname' ) . "</title>\n" );
    163163        _wp_render_title_tag();
    164164    }
     
    167167        $this->go_to( '?year=2015' );
    168168
    169         $this->expectOutputString( "<title>2015 &#8211; Test Blog</title>\n" );
     169        $this->expectOutputString( "<title>2015 &#8211; " . get_option( 'blogname' ) . "</title>\n" );
    170170        _wp_render_title_tag();
    171171    }
     
    174174        $this->go_to( '?monthnum=09' );
    175175
    176         $this->expectOutputString( "<title>September 2015 &#8211; Test Blog</title>\n" );
     176        $this->expectOutputString( "<title>September 2015 &#8211; " . get_option( 'blogname' ) . "</title>\n" );
    177177        _wp_render_title_tag();
    178178    }
     
    181181        $this->go_to( '?day=22' );
    182182
    183         $this->expectOutputString( "<title>September 22, 2015 &#8211; Test Blog</title>\n" );
     183        $this->expectOutputString( "<title>September 22, 2015 &#8211; " . get_option( 'blogname' ) . "</title>\n" );
    184184        _wp_render_title_tag();
    185185    }
     
    188188        $this->go_to( '?m=404' );
    189189
    190         $this->expectOutputString( "<title>Page not found &#8211; Test Blog</title>\n" );
     190        $this->expectOutputString( "<title>Page not found &#8211; " . get_option( 'blogname' ) . "</title>\n" );
    191191        _wp_render_title_tag();
    192192    }
     
    197197        add_filter( 'title_tag_parts', array( $this, '_paged_post_title_parts' ) );
    198198
    199         $this->expectOutputString( "<title>test_title &#8211; Page 4 &#8211; Test Blog</title>\n" );
     199        $this->expectOutputString( "<title>test_title &#8211; Page 4 &#8211; " . get_option( 'blogname' ) . "</title>\n" );
    200200        _wp_render_title_tag();
    201201    }
     
    215215        add_filter( 'document_title_parts', array( $this, '_rearrange_title_parts' ) );
    216216
    217         $this->expectOutputString( "<title>Test Blog &#8211; test_title</title>\n" );
     217        $this->expectOutputString( "<title>" . get_option( 'blogname' ) . " &#8211; test_title</title>\n" );
    218218        _wp_render_title_tag();
    219219    }
     
    233233        add_filter( 'document_title_separator', array( $this, '_change_title_separator' ) );
    234234
    235         $this->expectOutputString( "<title>test_title %% Test Blog</title>\n" );
     235        $this->expectOutputString( "<title>test_title %% " . get_option( 'blogname' ) . "</title>\n" );
    236236        _wp_render_title_tag();
    237237    }
Note: See TracChangeset for help on using the changeset viewer.