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
In many projects, I use an assertion about an object property value.
The error message in not explicit about why the assertion failed.
I think it would be a nice feature to handle enum name in the error message.
$foo = newFoo(BarEnum::Bar);
Assert::same($foo->getA(), BarEnum::Baz);
// Uncaught Webmozart\Assert\InvalidArgumentException: Expected a value identical to App\BarEnum. Got: App\BarEnum
Solution
Maybe the error message could look like this: Expected a value identical to App\BarEnum::Baz. Got: App\BarEnum::Bar.
I think the enum name is the most simple solution to implement as all enum type have a name.
If you agree with the proposed solution, I can opened a PR for this feature request.
The text was updated successfully, but these errors were encountered:
Context
In many projects, I use an assertion about an object property value.
The error message in not explicit about why the assertion failed.
I think it would be a nice feature to handle enum name in the error message.
Solution
Maybe the error message could look like this:
Expected a value identical to App\BarEnum::Baz. Got: App\BarEnum::Bar
.I think the enum name is the most simple solution to implement as all enum type have a name.
If you agree with the proposed solution, I can opened a PR for this feature request.
The text was updated successfully, but these errors were encountered: