Skip to content
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

Hotfix/ability to create invalid enums #12

Merged

Conversation

mirfilip
Copy link

@mirfilip mirfilip commented Feb 8, 2015

Done:

  • Some small changes to tests: removed unnecessary assertions, introduced data providers in couple of places
  • Fix the bug

@mnapoli please have a look.

/**
* @see https://github.com/myclabs/php-enum/issues/9
*/
$this->assertEquals(EnumFixture::PROBLEMATIC_NUMBER, EnumFixture::search(1));
Copy link
Member

Choose a reason for hiding this comment

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

Here we search for 1 and we check it returns PROBLEMATIC_NUMBER whose value is 0, is that normal?

Copy link
Author

Choose a reason for hiding this comment

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

No, it's not normal. I've just added that so that I could reference it in another bug ticket, since search() method is also not type safe. I'll fix that soon.

Copy link
Member

Choose a reason for hiding this comment

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

OK so we leave it that way for now but you are planning to fix it?

@mnapoli
Copy link
Member

mnapoli commented Feb 8, 2015

Very good stuff!

@mnapoli mnapoli added the bug label Feb 8, 2015
[EnumFixture::FOO, new EnumFixture(EnumFixture::FOO)],
[EnumFixture::BAR, new EnumFixture(EnumFixture::BAR)],
[(string) EnumFixture::NUMBER, new EnumFixture(EnumFixture::NUMBER)],
];
Copy link
Member

Choose a reason for hiding this comment

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

We have to keep BC with PHP 5.3 (yeah I know -_-)

Tests are failing because of that.

mnapoli added a commit that referenced this pull request Feb 10, 2015
…-enums

Hotfix/ability to create invalid enums
@mnapoli mnapoli merged commit 82d35ba into myclabs:master Feb 10, 2015
@mnapoli mnapoli mentioned this pull request Feb 10, 2015
@mirfilip mirfilip deleted the hotfix/ability-to-create-invalid-enums branch February 10, 2015 09:03
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