ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ReferenceHelperTest.php
Go to the documentation of this file.
1 <?php
2 
3 
5 {
6 
7  public function setUp()
8  {
9  if (!defined('PHPEXCEL_ROOT')) {
10  define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
11  }
12  require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
13  }
14 
15  public function testColumnSort()
16  {
17  $columnBase = $columnExpectedResult = array(
18  'A','B','Z',
19  'AA','AB','AZ',
20  'BA','BB','BZ',
21  'ZA','ZB','ZZ',
22  'AAA','AAB','AAZ',
23  'ABA','ABB','ABZ',
24  'AZA','AZB','AZZ',
25  'BAA','BAB','BAZ',
26  'BBA','BBB','BBZ',
27  'BZA','BZB','BZZ'
28  );
29  shuffle($columnBase);
30  usort($columnBase, array('PHPExcel_ReferenceHelper','columnSort'));
31  foreach($columnBase as $key => $value) {
32  $this->assertEquals($columnExpectedResult[$key], $value);
33  }
34  }
35 
36  public function testColumnReverseSort()
37  {
38  $columnBase = $columnExpectedResult = array(
39  'A','B','Z',
40  'AA','AB','AZ',
41  'BA','BB','BZ',
42  'ZA','ZB','ZZ',
43  'AAA','AAB','AAZ',
44  'ABA','ABB','ABZ',
45  'AZA','AZB','AZZ',
46  'BAA','BAB','BAZ',
47  'BBA','BBB','BBZ',
48  'BZA','BZB','BZZ'
49  );
50  shuffle($columnBase);
51  $columnExpectedResult = array_reverse($columnExpectedResult);
52  usort($columnBase, array('PHPExcel_ReferenceHelper','columnReverseSort'));
53  foreach($columnBase as $key => $value) {
54  $this->assertEquals($columnExpectedResult[$key], $value);
55  }
56  }
57 
58 }
Create styles array
The data for the language used.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
$key
Definition: croninfo.php:18