Replies: 1 comment
-
I have recently learned that the way to solve this is by using expect()->toEqualCanonicalizing in Pest or $this->assertEqualsCanonicalizing in PHPUnit. Closing this discussion. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Collection::shuffle
makes use of theRandomizer
class of PHP and instantiates one as needed.When running tests that make use of this it makes writing tests around it a bit more tedious.
To solve this, I suggest resolving Randomizer using the service container.
If a more gradual approach is wanted, using an alias like
arr.randomizer
could be an option.To set the Randomizer, either a manual binding to the class (or alias) can be done, or be creating a new static method to set the Randomizer:
I’d be happy to provide a PR for this.
Beta Was this translation helpful? Give feedback.
All reactions