Make WordPress Core

Changeset 35257


Ignore:
Timestamp:
10/18/2015 04:50:15 AM (8 years ago)
Author:
johnbillion
Message:

Add is_embed() to WP_UnitTestCase::assertQueryTrue() and update the relevant embed tests.

See #32522

Location:
trunk/tests/phpunit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/testcase.php

    r35242 r35257  
    525525        global $wp_query;
    526526        $all = array(
    527             'is_single', 'is_preview', 'is_page', 'is_archive', 'is_date', 'is_year', 'is_month', 'is_day', 'is_time',
    528             'is_author', 'is_category', 'is_tag', 'is_tax', 'is_search', 'is_feed', 'is_comment_feed', 'is_trackback',
    529             'is_home', 'is_404', 'is_comments_popup', 'is_paged', 'is_admin', 'is_attachment', 'is_singular', 'is_robots',
    530             'is_posts_page', 'is_post_type_archive',
     527            'is_404',
     528            'is_admin',
     529            'is_archive',
     530            'is_attachment',
     531            'is_author',
     532            'is_category',
     533            'is_comment_feed',
     534            'is_comments_popup',
     535            'is_date',
     536            'is_day',
     537            'is_embed',
     538            'is_feed',
     539            'is_home',
     540            'is_month',
     541            'is_page',
     542            'is_paged',
     543            'is_post_type_archive',
     544            'is_posts_page',
     545            'is_preview',
     546            'is_robots',
     547            'is_search',
     548            'is_single',
     549            'is_singular',
     550            'is_tag',
     551            'is_tax',
     552            'is_time',
     553            'is_trackback',
     554            'is_year',
    531555        );
    532556        $true = func_get_args();
     
    551575        $message = '';
    552576        if ( count($not_true) )
    553             $message .= implode( $not_true, ', ' ) . ' should be true. ';
     577            $message .= implode( $not_true, ', ' ) . ' is expected to be true. ';
    554578        if ( count($not_false) )
    555             $message .= implode( $not_false, ', ' ) . ' should be false.';
     579            $message .= implode( $not_false, ', ' ) . ' is expected to be false.';
    556580        $this->assertTrue( $passed, $message );
    557581    }
  • trunk/tests/phpunit/tests/oembed/template.php

    r35255 r35257  
    1818        $this->go_to( get_post_embed_url( $post_id ) );
    1919
    20         $this->assertQueryTrue( 'is_single', 'is_singular' );
     20        $this->assertQueryTrue( 'is_single', 'is_singular', 'is_embed' );
    2121
    2222        ob_start();
     
    4444        $this->go_to( get_post_embed_url( $post_id ) );
    4545
    46         $this->assertQueryTrue( 'is_single', 'is_singular' );
     46        $this->assertQueryTrue( 'is_single', 'is_singular', 'is_embed' );
    4747
    4848        ob_start();
     
    6161        $GLOBALS['wp_query']->query_vars['embed'] = true;
    6262
    63         $this->assertQueryTrue( 'is_404' );
     63        $this->assertQueryTrue( 'is_404', 'is_embed' );
    6464
    6565        ob_start();
     
    8484        $this->go_to( get_post_embed_url( $attachment_id ) );
    8585
    86         $this->assertQueryTrue( 'is_single', 'is_singular', 'is_attachment' );
     86        $this->assertQueryTrue( 'is_single', 'is_singular', 'is_attachment', 'is_embed' );
    8787
    8888        ob_start();
     
    107107        $this->go_to( get_post_embed_url( $post_id ) );
    108108
    109         $this->assertQueryTrue( 'is_404' );
     109        $this->assertQueryTrue( 'is_404', 'is_embed' );
    110110
    111111        ob_start();
     
    129129        $this->go_to( get_post_embed_url( $post_id ) );
    130130
    131         $this->assertQueryTrue( 'is_404' );
     131        $this->assertQueryTrue( 'is_404', 'is_embed' );
    132132
    133133        ob_start();
     
    150150        $this->go_to( get_post_embed_url( $post_id ) );
    151151
    152         $this->assertQueryTrue( 'is_404' );
     152        $this->assertQueryTrue( 'is_404', 'is_embed' );
    153153
    154154        ob_start();
     
    175175        $this->go_to( get_post_embed_url( $post_id ) );
    176176
    177         $this->assertQueryTrue( 'is_single', 'is_singular' );
     177        $this->assertQueryTrue( 'is_single', 'is_singular', 'is_embed' );
    178178
    179179        ob_start();
Note: See TracChangeset for help on using the changeset viewer.