I am trying to assert that specific key of my nested array contains given value. For example: I have this:
$owners=[12,15];
Here is API response's key that I get from server:
$response=[
'name'=>'Test',
'type_id'=>2,
'owners'=>[
[
'resource_id'=>132,
'name'=>'Jonathan'
],
[
'resource_id'=>25,
'name'=>'Yosh'
]
]
];
I want to check that the at least one of my owner's array should have resource_id as 132. I feel there has been an assertion in PHPUnit assertArraySubset but it may have been deprecated.
Can anyone tell how I can match key with specific value in nested array? I could not see any method in PHPUnit framework for that.
PS. Sorry for poor formatting of code, I don't know how to properly intend it here on SO. Thanks