-
-
Notifications
You must be signed in to change notification settings - Fork 73
Assert::isEqual: can compare recursive objects [Closes #93] #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Tester/Framework/Assert.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure about this one? I think there should be &&
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why && ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, I just woke up and it looks weird :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't there be the path problem that milo tried to solve?
|
@milo any objections? |
|
Nice and elegant! I had to sit and draw it on paper :) Comments in code. |
Tester/Framework/Assert.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe shorter:
if (isset($checked[$expected])) {
return $checked[$expected] === $actual;
} elseif (isset($checked[$actual])) {
return FALSE;
} elseif ($expected === $actual) {
return TRUE;
}Btw. second elseif seems logically, but test passes without it too. It just returns FALSE on next level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in this case the second if is unnecessary, because $expected !== $actual. Repushed.
Now it is really very simple implementation ;-)
|
Great. I would merge it soon if no one complains. |
|
👍 |
Assert::isEqual: can compare recursive objects [Closes #93]
|
👏 |
No description provided.