After updating the Palantir Behat Extension in my project, when running the Behat test And entity field ":field" should contain ":value", the following error is thrown:
Warning: in_array() expects parameter 2 to be array, string given in vendor/palantirnet/palantir-behat-extension/src/Palantirnet/PalantirBehatExtension/Context/EntityDataContext.php line 167
After updating the Palantir Behat Extension in my project, when running the Behat test And entity field ":field" should contain ":value", the following error is thrown:
Problem
I believe I have traced down the problem to a specific commit that updated the syntax to meet coding standards: https://github.com/palantirnet/palantir-behat-extension/commit/c3db3c633696cc226fbadf505b7275915c067ee1#diff-8ffb0019c702b772d868f118a4621955R167 (Line 167 of EntityDataContext.php for commit c3db3c633696cc226fbadf505b7275915c067ee1)
Potential Solution
Line 163 of the above file also seems strange to me:
I may be reading this wrong, but the if statement checks if _$fieldvalue is an array and if it is makes it an array? Changing this to:
fixes my issue.
Update: I think this was translated from:
with the check being backward.