Uninformative message when failing to assert that an object and a string are equal
willemstuursma opened this issue · comments
Willem commented
We have lots of Assert::eq("EUR", $currency);
where $currency
implements __toString()
.
The comparison works well, but in case of inequality the error message is really unclear: Expected a value equal to Money\Currency. Got: "EUR"
It would be great \Webmozart\Assert\Assert::valueToString()
would check on this.
If you agree, I can provide a PR.
Tobias Nyholm commented
Thank you for this issue. I think it could be a bit tricky but I do understand your use case. I would be happy to review a PR.
Guilliam Xavier commented