I have an assertion to check a key in an array in my CodeCeption tests. The test calls a REST API and checks the returned response.
I have this command:
$I->assertContains("key", $resp);
The output is:
Step Assert contains "key",{"key":"0m-5m","price":10000,"text":"۰ تا ۵ دقیقه"}
Fail Failed asserting that an array contains 'key'.
But when I change the command to the following, everything works fine:
$I->assertInternalType("string", $resp["key"]);
This behavior shows that there is a key named key in my $resp object.
I supposed that the cause may be the UTF-8 characters, since I've been using asserContains a hundred times before and it works as a charm.
Any idea how to solve the issue?