Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#40411 closed enhancement (fixed)

Improve the failure message reported by assertQueryTrue()

Reported by: johnbillion's profile johnbillion Owned by: johnbillion's profile 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 8 years ago.

Download all attachments as: .zip

Change History (3)

@johnbillion
8 years ago

#1 @johnbillion
8 years 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
8 years 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.