public function testOrderByTensThenDescending(\Pinq\ITraversable $traversable, array $data)
{
$traversable = $traversable->orderByAscending(function ($i) {
return (int) ($i / 10);
})->thenByDescending(function ($i) {
return $i;
});
$equivalentArray = [];
$array = [];
foreach ($data as $key => $value) {
if ($value % 10 === 0) {
$equivalentArray += array_reverse($array, true);
$array = [];
}
$array[$key] = $value;
}
$equivalentArray += array_reverse($array, true);
$this->assertMatches($traversable, $equivalentArray);
}