Closed ianlet closed 10 years ago
I think it should pass because you have created $orderId and $productId both with the same uuid string.
So when they are compared within equals method they both are casted to strings (and they are equal) and test passes (as it should).
I'm pointing this out because of the description of the method. I agree with what you say but based on @mathiasverraes description it should compare the value and the type as well.
Thanks, my current thinking is that it's a bug indeed. If two objects of different types share the same value, it can be
proof and fix: https://github.com/event-centric/EventCentric.Core/pull/12
In EventCentric\Identifiers\Identifier.php, comment of method 'equals' says it should compare the value and the type of both Identifier object. But, the implementations (the fixtures) never do it. So for instance, using the equals method between an OrderId and a ProductId with same string value (I'm aware that it should not happen) will return true.
The following test is passing :
Is it an issue that should be corrected?