WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#37851 closed defect (bug) (fixed)

Tests in Tests_Query_Conditionals fail when run independently

Reported by: johnbillion Owned by: johnbillion
Milestone: 4.7 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords:
Focuses: Cc:

Description

Some tests in the Tests_Query_Conditionals class fail when run via phpunit --filter Tests_Query_Conditionals. When running the test suite as a whole, they pass as expected.

There were 6 failures:

1) Tests_Query_Conditionals::test_category_feed
is_archive, is_category is expected to be true. is_comment_feed, is_page, is_singular is expected to be false.
Failed asserting that false is true.

~/tests/phpunit/includes/testcase.php:626
~/tests/phpunit/tests/query/conditionals.php:363

2) Tests_Query_Conditionals::test_category_paged
is_archive, is_category, is_paged is expected to be true. is_404 is expected to be false.
Failed asserting that false is true.

~/tests/phpunit/includes/testcase.php:626
~/tests/phpunit/tests/query/conditionals.php:379

3) Tests_Query_Conditionals::test_category
is_archive, is_category is expected to be true. is_404 is expected to be false.
Failed asserting that false is true.

~/tests/phpunit/includes/testcase.php:626
~/tests/phpunit/tests/query/conditionals.php:386

4) Tests_Query_Conditionals::test_tag_feed
is_archive, is_tag is expected to be true. is_comment_feed, is_page, is_singular is expected to be false.
Failed asserting that false is true.

~/tests/phpunit/includes/testcase.php:626
~/tests/phpunit/tests/query/conditionals.php:397

5) Tests_Query_Conditionals::test_tag_paged
is_archive, is_paged, is_tag is expected to be true. is_404 is expected to be false.
Failed asserting that false is true.

~/tests/phpunit/includes/testcase.php:626
~/tests/phpunit/tests/query/conditionals.php:415

6) Tests_Query_Conditionals::test_tag
is_archive, is_tag is expected to be true. is_404 is expected to be false.
Failed asserting that false is true.

~/tests/phpunit/includes/testcase.php:626
~/tests/phpunit/tests/query/conditionals.php:422

Change History (3)

#1 @johnbillion
4 years ago

  • Owner set to johnbillion
  • Resolution set to fixed
  • Status changed from new to closed

In 38407:

Build/Test tools: Ensure the Tests_Query_Conditionals tests set up the environment correctly before re-registering initial taxonomies.

Fixes #37851

#2 @johnbillion
4 years ago

  • Keywords needs-patch removed

#3 @johnbillion
4 years ago

In 38413:

Query: Add and improve tests for query conditionals on the front page and home page.

See #37851

Note: See TracTickets for help on using tickets.