beausimensen,
@beausimensen@phpc.social avatar

Are there examples of getting pretty output from for custom assertions?

Projects like prove you can do a lot with phpunit’s output. I’m hoping it doesn’t take that much work to hook into correctly displaying information when an assertion fails, though.

So, two questions:

If I write a custom assertion, can I be creative with how failures display?

Can I hook into the built-in assertions and conditionally tweak their display?

Solid and creative examples welcome. :)

alessandrolai,
@alessandrolai@phpc.social avatar

@beausimensen it may depend a lot on the PHPUnit version: v10 had a big overhaul and it has an internal event system that would make any change a lot easier. You would have to hook into the right events and act accordingly.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • php
  • ethstaker
  • DreamBathrooms
  • osvaldo12
  • InstantRegret
  • ngwrru68w68
  • magazineikmin
  • mdbf
  • thenastyranch
  • Youngstown
  • slotface
  • everett
  • kavyap
  • Durango
  • tester
  • JUstTest
  • GTA5RPClips
  • tacticalgear
  • modclub
  • khanakhh
  • rosin
  • cisconetworking
  • normalnudes
  • provamag3
  • Leos
  • cubers
  • anitta
  • megavids
  • lostlight
  • All magazines