An assertion interface for Queue::assertPushed() similar to Bus::assertChained() #51687
Unanswered
ChrGriffin
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Bus::assertChained()
utilizes some black magic to compare properties passed into the chained jobs, even if those properties are private.However,
Queue::assertPushed()
takes a callback that should returntrue
orfalse
. And within that callback, if a property is private, obviously one cannot compare it.It always feels icky to me to make properties public or add getters just to be able to compare them in tests. I will admit I haven't dug into the source code behind either of these assertions, but if there were a way to apply whatever principle allows assertChained to inspect those properties to assertPushed, that would be be great! But of course, I must concede that this is mostly to satisfy a personal "ick" factor and wouldn't have a lot of benefit beyond that, so I can't imagine it's worth a lot of work.
Beta Was this translation helpful? Give feedback.
All reactions