lithium\test\Mocker::mergeResults()
Will merge two sets of results into each other.
Parameters
-
array
$results
-
array
$secondary
Returns
arraySource
public static function mergeResults($results, $secondary) {
foreach ($results as $method => $calls) {
if (isset($secondary[$method])) {
$results['method1'] = array_merge($results['method1'], $secondary['method1']);
usort($results['method1'], function($el1, $el2) {
return strcmp($el1['time'], $el2['time']);
});
unset($secondary['method1']);
}
}
return $results + $secondary;
}