You are here

public function ReferenceHelperTest::testColumnReverseSort in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/ReferenceHelperTest.php \ReferenceHelperTest::testColumnReverseSort()

File

vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/ReferenceHelperTest.php, line 36

Class

ReferenceHelperTest

Code

public function testColumnReverseSort() {
  $columnBase = $columnExpectedResult = array(
    'A',
    'B',
    'Z',
    'AA',
    'AB',
    'AZ',
    'BA',
    'BB',
    'BZ',
    'ZA',
    'ZB',
    'ZZ',
    'AAA',
    'AAB',
    'AAZ',
    'ABA',
    'ABB',
    'ABZ',
    'AZA',
    'AZB',
    'AZZ',
    'BAA',
    'BAB',
    'BAZ',
    'BBA',
    'BBB',
    'BBZ',
    'BZA',
    'BZB',
    'BZZ',
  );
  shuffle($columnBase);
  $columnExpectedResult = array_reverse($columnExpectedResult);
  usort($columnBase, array(
    'PHPExcel_ReferenceHelper',
    'columnReverseSort',
  ));
  foreach ($columnBase as $key => $value) {
    $this
      ->assertEquals($columnExpectedResult[$key], $value);
  }
}