Ejemplo n.º 1
0
 /**
  * Tests SortArray::sortByWeightAndTitleKey() input against expected output.
  *
  * @dataProvider providerTestSortByWeightAndTitleKey
  *
  * @param array $a
  *   The first input item for comparison.
  * @param array $b
  *   The second item for comparison.
  * @param integer $expected
  *   The expected output from calling the method.
  */
 public function testSortByWeightAndTitleKey($a, $b, $expected)
 {
     $result = SortArray::sortByWeightAndTitleKey($a, $b);
     $this->assertEquals($expected, $result);
 }
Ejemplo n.º 2
0
 /**
  * Sort language objects.
  *
  * @param array $languages
  *   The array of language objects keyed by langcode.
  */
 public static function sort(&$languages)
 {
     uasort($languages, function ($a, $b) {
         return SortArray::sortByWeightAndTitleKey($a, $b, 'weight', 'name');
     });
 }