You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run test with dataprovider wich contains non-backed enum
What do you get instead?
When run unit tests and some test is fail, console output get an extra exception in addition to main error:
[JsonException] Non-backed enums have no default serialization
I have explored this and found that exception is thrown for test with dataprovider, contained non-backed enums in example case. When run separately, this test works correctly.
I have debuged PHPUnit and then Codecepton and found place where exception is thow: it is json_encode() call in \Codeception\Test\Descriptor::getTestSignatureUnique() class. When json_encode() try to serialize non-backed enum wich is not serializable, it thows such exception. I assume there should be added checking if example data is serializable.
What are you trying to achieve?
Run test with dataprovider wich contains non-backed enum
What do you get instead?
When run unit tests and some test is fail, console output get an extra exception in addition to main error:
I have explored this and found that exception is thrown for test with dataprovider, contained non-backed enums in example case. When run separately, this test works correctly.
I have debuged PHPUnit and then Codecepton and found place where exception is thow: it is
json_encode()
call in\Codeception\Test\Descriptor::getTestSignatureUnique()
class. Whenjson_encode()
try to serialize non-backed enum wich is not serializable, it thows such exception. I assume there should be added checking if example data is serializable.Details
The text was updated successfully, but these errors were encountered: