sortObjectsByProperty() public method

public sortObjectsByProperty ( array $objects, string $sortBy, string $sortDirection = 'ASC' ) : array
$objects array
$sortBy string
$sortDirection string
return array
Example #1
0
 /**
  * @test
  * @dataProvider getSortObjectsTestValues
  * @param array $input
  * @param string $sortBy
  * @param string $direction
  * @param array $expectedOutput
  */
 public function testSortObjectsByProperty($input, $sortBy, $direction, $expectedOutput)
 {
     $service = new FluxService();
     $sorted = $service->sortObjectsByProperty($input, $sortBy, $direction);
     $this->assertEquals($expectedOutput, $sorted);
 }