You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within a test case using mocks where I don't care what the parameter value exactly is, but want to make sure it didn't change I do the following
// Find record in cache$this->redisMock->expects(self::once())
->method('get')
// Compare key to key snapshot
->with($this->snapshotConstraint())
->willReturn(json_encode($data, JSON_THROW_ON_ERROR));
I guess this can be implemented in a better way by defining a new constraint class extending the PHPUnit Constraint.
This discussion was converted from issue #137 on May 31, 2022 13:49.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This package is great! I just wanted to share some thoughts.
Inside tests using
MatchesSnpashots
trait I started adding this handy function.Within a test case using mocks where I don't care what the parameter value exactly is, but want to make sure it didn't change I do the following
I guess this can be implemented in a better way by defining a new constraint class extending the PHPUnit Constraint.
Beta Was this translation helpful? Give feedback.
All reactions