Пример #1
0
 /**
  * @covers Fuel\Common\Arr::multisort
  * @group Common
  */
 public function testMultisort()
 {
     $input = array('i5' => array('name' => 'Carl', 'age' => 17, 'points' => 30, 'arr' => array('key' => 10)), 'i7' => array('name' => 'carl', 'age' => 17, 'points' => 20, 'arr' => array('key' => 10)), 'i2' => array('name' => 'Bert', 'age' => 20, 'points' => 30, 'arr' => array('key' => 10)));
     $expected = array('i2' => array('name' => 'Bert', 'age' => 20, 'points' => 30, 'arr' => array('key' => 10)), 'i7' => array('name' => 'carl', 'age' => 17, 'points' => 20, 'arr' => array('key' => 10)), 'i5' => array('name' => 'Carl', 'age' => 17, 'points' => 30, 'arr' => array('key' => 10)));
     $result = Arr::multisort($input, array('name' => SORT_ASC, 'points' => array(SORT_ASC, SORT_NUMERIC), 'age' => array(SORT_ASC, SORT_NUMERIC)), true);
     $this->assertEquals($expected, $result);
 }