WordPress.org

Make WordPress Core

Opened 3 weeks ago

Closed 3 weeks ago

#40411 closed enhancement (fixed)

Improve the failure message reported by assertQueryTrue()

Reported by: johnbillion Owned by: johnbillion
Milestone: 4.8 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

When an assertion made with assertQueryTrue() fails, its failure message is quite confusing. It can be made much clearer.

Attachments (1)

40411.patch (2.1 KB) - added by johnbillion 3 weeks ago.

Download all attachments as: .zip

Change History (3)

@johnbillion
3 weeks ago

#1 @johnbillion
3 weeks ago

  • Keywords has-patch added; needs-patch removed

With 40411.patch:

Before:

is_home, is_page is expected to be true. is_single is expected to be false.
Failed asserting that false is true.

After:

is_home is false but is expected to be true.
is_page is false but is expected to be true.
is_single is true but is expected to be false.

#2 @johnbillion
3 weeks ago

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

In 40416:

Build/Test tools: Improve the failure message reported by assertQueryTrue() so it's a little less cryptic.

Fixes #40411

Note: See TracTickets for help on using tickets.