Skip to content

Add default failure messages to the remaining string expectations - #1948

Open
VincentBorgers wants to merge 1 commit into
pestphp:5.xfrom
VincentBorgers:default-failure-messages-string-expectations
Open

VincentBorgers wants to merge 1 commit into
pestphp:5.xfrom
VincentBorgers:default-failure-messages-string-expectations

Conversation

@VincentBorgers

Copy link
Copy Markdown

What:

  • Bug Fix
  • New Feature

Description:

Thirteen string expectations fall back to PHPUnit's Failed asserting that false is true. when they fail, while their siblings (toBeEmail, toBeUrl, toBeSlug, and the case expectations) already build a descriptive default message.

This adds matching default messages to the remaining string expectations, so each one reports what it checked: toBeDigits, toBeUppercase, toBeLowercase, toBeAlphaNumeric, toBeAlpha, toBeUuid, toBeUlid, toBeIpAddress, toBeMacAddress, toBeHostname, toBeDomain, toBeBase64, and toBeHexadecimal.

A custom message passed to the expectation still takes precedence. Each expectation's test gains a failures with default message case, and the success snapshot is updated.

@VincentBorgers
VincentBorgers force-pushed the default-failure-messages-string-expectations branch from 315bc30 to 39e2bc1 Compare October 5, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant