Beispiel #1
0
 public function testSortRecursive()
 {
     $array = ['users' => [['name' => 'joe', 'mail' => '*****@*****.**', 'numbers' => [2, 1, 0]], ['name' => 'jane', 'age' => 25]], 'repositories' => [['id' => 1], ['id' => 0]], 20 => [2, 1, 0], 30 => [2 => 'a', 1 => 'b', 0 => 'c']];
     $expect = [20 => [0, 1, 2], 30 => [0 => 'c', 1 => 'b', 2 => 'a'], 'repositories' => [['id' => 0], ['id' => 1]], 'users' => [['age' => 25, 'name' => 'jane'], ['mail' => '*****@*****.**', 'name' => 'joe', 'numbers' => [0, 1, 2]]]];
     $this->assertEquals($expect, Arr::sortRecursive($array));
 }