almo's avatar
Level 3

Struggling with Integrated to test imbricated arrays

Hello,

I can't get seeJsonContains($array) working properly with imbricated jsons.

I'm returning from my controller this array :

$array = 
[
    'user' => [
      'email' => $email
    ]
]

So it's converted by the response()->json($array) to :

{
    "user": {
        "email": "john@local.host"
    }
}

But whenever I call :

$this->seeJsonContains([
    'user' => [
         'email' => 'john@local.host' 
    ]
]);

My test fails.

Any idea ?

0 likes
0 replies

Please or to participate in this conversation.