I have such result from my code that I am trying to test:
$result = [
[
"lable" => "first", ["type" => "customer", "balance" => 1000],
],
[
"lable" => "another", ["type" => "retailer", "balance" => 1500],
],
]
so I want to test my code and assert that is there any item in my result With balance
more than 1200.
also, I want To assert that is there any customer
type object in the value?
2
Answers
You could use
array_reduce()
for this:There is no straight way to use a built-in function, You can do something like this: