Make WordPress Core

Changeset 38405


Ignore:
Timestamp:
08/27/2016 03:27:35 PM (9 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Add support for is_front_page() to assertQueryTrue() and assert that all the tested conditions are supported by the method.

Fixes #37849

Location:
trunk/tests/phpunit
Files:
2 edited

Legend:

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

    r38398 r38405  
    578578            'is_embed',
    579579            'is_feed',
     580            'is_front_page',
    580581            'is_home',
    581582            'is_month',
     
    597598        $true = func_get_args();
    598599
     600        foreach ( $true as $true_thing ) {
     601            $this->assertContains( $true_thing, $all, "{$true_thing}() is not handled by assertQueryTrue()." );
     602        }
     603
    599604        $passed = true;
    600605        $not_false = $not_true = array(); // properties that were not set to expected values
  • trunk/tests/phpunit/tests/query/conditionals.php

    r36625 r38405  
    3030    function test_home() {
    3131        $this->go_to('/');
    32         $this->assertQueryTrue('is_home');
     32        $this->assertQueryTrue( 'is_home', 'is_front_page' );
    3333    }
    3434
     
    256256        for ( $i = 2; $i <= 3; $i++ ) {
    257257            $this->go_to("/page/{$i}/");
    258             $this->assertQueryTrue('is_home', 'is_paged');
     258            $this->assertQueryTrue( 'is_home', 'is_front_page', 'is_paged' );
    259259        }
    260260    }
Note: See TracChangeset for help on using the changeset viewer.