diff --git a/tests/phpunit/includes/testcase.php b/tests/phpunit/includes/testcase.php index d278887f6f..288f7fe01a 100644 --- a/tests/phpunit/includes/testcase.php +++ b/tests/phpunit/includes/testcase.php @@ -577,6 +577,7 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase { 'is_day', 'is_embed', 'is_feed', + 'is_front_page', 'is_home', 'is_month', 'is_page', @@ -596,6 +597,10 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase { ); $true = func_get_args(); + foreach ( $true as $true_thing ) { + $this->assertContains( $true_thing, $all, "{$true_thing}() is not handled by assertQueryTrue()." ); + } + $passed = true; $not_false = $not_true = array(); // properties that were not set to expected values diff --git a/tests/phpunit/tests/query/conditionals.php b/tests/phpunit/tests/query/conditionals.php index 7606dba9c4..b09b753fc8 100644 --- a/tests/phpunit/tests/query/conditionals.php +++ b/tests/phpunit/tests/query/conditionals.php @@ -29,7 +29,7 @@ class Tests_Query_Conditionals extends WP_UnitTestCase { function test_home() { $this->go_to('/'); - $this->assertQueryTrue('is_home'); + $this->assertQueryTrue( 'is_home', 'is_front_page' ); } function test_404() { @@ -255,7 +255,7 @@ class Tests_Query_Conditionals extends WP_UnitTestCase { self::factory()->post->create_many( 5 ); for ( $i = 2; $i <= 3; $i++ ) { $this->go_to("/page/{$i}/"); - $this->assertQueryTrue('is_home', 'is_paged'); + $this->assertQueryTrue( 'is_home', 'is_front_page', 'is_paged' ); } }