Skip to content

Conversation

marc-mabe
Copy link
Owner

… in cases both enumerators are the same but of different instances. This can happen because of the issue with serializable singletons

@marc-mabe marc-mabe added the bug label Dec 3, 2016
@marc-mabe marc-mabe force-pushed the Enum_is_unserialized branch from 53e5104 to 1b550d1 Compare December 3, 2016 23:05
@marc-mabe
Copy link
Owner Author

marc-mabe commented Dec 3, 2016

@prolic @delbertooo This PR is updating the method Enum::is() to allow comparing two instances of the same type by value. see #76

$enum2 = unserialize(serialize($enum1));

$this->assertFalse($enum1 === $enum2, 'Wrong test implementation');
$this->assertTrue($enum1->is($enum2), 'Two different instances of exact the same enumerator shoulw be equal');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should

@prolic
Copy link
Collaborator

prolic commented Dec 4, 2016

Nice!

@marc-mabe marc-mabe force-pushed the Enum_is_unserialized branch from 1b550d1 to 1ee4865 Compare December 4, 2016 18:51
…merators are the same but of different instances. This can happen because of the issue with serializable singletons
@marc-mabe marc-mabe force-pushed the Enum_is_unserialized branch from 1ee4865 to 0c9a7f7 Compare December 4, 2016 18:52
@marc-mabe
Copy link
Owner Author

fixed typo and updated documentation

@marc-mabe marc-mabe merged commit 552324c into master Dec 6, 2016
@marc-mabe marc-mabe added this to the 2.3.0 milestone Dec 7, 2016
@marc-mabe marc-mabe deleted the Enum_is_unserialized branch December 7, 2016 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants