FlaggedEnumTest fails
ovgray opened this issue · 1 comments
After your code changes FlaggedEnumTest fails at line 42 (running php 5.3.5 (windows)). The error message is:
"Fatal error: Cannot call abstract method Biplane\EnumBundle\Enumeration\EnumInterface::getPossibleValues() in C:\xampp\htdocs\BiplaneEnumBundle\Enumeration\FlaggedEnum.php on line 92"
My debugging skills aren't very good, but it appears that when you get the InvalidFlagsEnum::getBitmask by reflection and then invoke it, the method behaves as though it was called from the parent FlaggedEnum (for example in the first line of the method, $enumType gets set to Biplane\EnumBundle\Enumeration\FlaggedEnum).
I rewrite test as:
/**
* @expectedException \UnexpectedValueException
*/
public function testThrowExceptionWhenBitmaskIsInvalid()
{
\Biplane\EnumBundle\Tests\Fixtures\InvalidFlagsEnum::create(1);
}
The test passes, which seems to indicate that getBitmask is working properly.
So perhaps it is just the current test that is a problem: some quirk of Reflection on php 5.3.5 (perhaps https://bugs.php.net/bug.php?id=53742).
Since the bundle is meant to work for php >=5.3.2, should the tests also work for php >=5.3.2?
I've updated the failed test by your example. Thanks!