ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
AutofilterColumnTest Class Reference
+ Inheritance diagram for AutofilterColumnTest:
+ Collaboration diagram for AutofilterColumnTest:

Public Member Functions

 setUp ()
 
 testGetColumnIndex ()
 
 testSetColumnIndex ()
 
 testGetParent ()
 
 testSetParent ()
 
 testGetFilterType ()
 
 testSetFilterType ()
 
 testSetInvalidFilterTypeThrowsException ()
 PHPExcel_Exception More...
 
 testGetJoin ()
 
 testSetJoin ()
 
 testSetInvalidJoinThrowsException ()
 PHPExcel_Exception More...
 
 testSetAttributes ()
 
 testGetAttributes ()
 
 testSetAttribute ()
 
 testGetAttribute ()
 
 testClone ()
 

Private Attributes

 $_testInitialColumn = 'H'
 
 $_testAutoFilterColumnObject
 
 $_mockAutoFilterObject
 

Detailed Description

Definition at line 4 of file ColumnTest.php.

Member Function Documentation

◆ setUp()

AutofilterColumnTest::setUp ( )

Definition at line 12 of file ColumnTest.php.

References defined.

13  {
14  if (!defined('PHPEXCEL_ROOT')) {
15  define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
16  }
17  require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
18 
19  $this->_mockAutoFilterObject = $this->getMockBuilder('PHPExcel_Worksheet_AutoFilter')
20  ->disableOriginalConstructor()
21  ->getMock();
22 
23  $this->_mockAutoFilterObject->expects($this->any())
24  ->method('testColumnInRange')
25  ->will($this->returnValue(3));
26 
27  $this->_testAutoFilterColumnObject = new PHPExcel_Worksheet_AutoFilter_Column(
28  $this->_testInitialColumn,
29  $this->_mockAutoFilterObject
30  );
31  }
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

◆ testClone()

AutofilterColumnTest::testClone ( )

Definition at line 167 of file ColumnTest.php.

References $_testAutoFilterColumnObject, and $result.

168  {
170  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
171  }
$result

◆ testGetAttribute()

AutofilterColumnTest::testGetAttribute ( )

Definition at line 151 of file ColumnTest.php.

References $result, and array.

152  {
153  $attributeSet = array( 'val' => 100,
154  'maxVal' => 200
155  );
156 
157  $this->_testAutoFilterColumnObject->setAttributes($attributeSet);
158 
159  foreach($attributeSet as $attributeName => $attributeValue) {
160  $result = $this->_testAutoFilterColumnObject->getAttribute($attributeName);
161  $this->assertEquals($attributeValue, $result);
162  }
163  $result = $this->_testAutoFilterColumnObject->getAttribute('nonExistentAttribute');
164  $this->assertNull($result);
165  }
$result
Create styles array
The data for the language used.

◆ testGetAttributes()

AutofilterColumnTest::testGetAttributes ( )

Definition at line 125 of file ColumnTest.php.

References $result, and array.

126  {
127  $attributeSet = array( 'val' => 100,
128  'maxVal' => 200
129  );
130 
131  $this->_testAutoFilterColumnObject->setAttributes($attributeSet);
132 
133  $result = $this->_testAutoFilterColumnObject->getAttributes();
134  $this->assertTrue(is_array($result));
135  $this->assertEquals(count($attributeSet), count($result));
136  }
$result
Create styles array
The data for the language used.

◆ testGetColumnIndex()

AutofilterColumnTest::testGetColumnIndex ( )

Definition at line 33 of file ColumnTest.php.

References $result.

34  {
35  $result = $this->_testAutoFilterColumnObject->getColumnIndex();
36  $this->assertEquals($this->_testInitialColumn, $result);
37  }
$result

◆ testGetFilterType()

AutofilterColumnTest::testGetFilterType ( )

Definition at line 64 of file ColumnTest.php.

References $result, and PHPExcel_Worksheet_AutoFilter_Column\AUTOFILTER_FILTERTYPE_FILTER.

65  {
66  $result = $this->_testAutoFilterColumnObject->getFilterType();
68  }
$result

◆ testGetJoin()

AutofilterColumnTest::testGetJoin ( )

Definition at line 89 of file ColumnTest.php.

References $result, and PHPExcel_Worksheet_AutoFilter_Column\AUTOFILTER_COLUMN_JOIN_OR.

90  {
91  $result = $this->_testAutoFilterColumnObject->getJoin();
93  }
$result

◆ testGetParent()

AutofilterColumnTest::testGetParent ( )

Definition at line 51 of file ColumnTest.php.

References $result.

52  {
53  $result = $this->_testAutoFilterColumnObject->getParent();
54  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
55  }
$result

◆ testSetAttribute()

AutofilterColumnTest::testSetAttribute ( )

Definition at line 138 of file ColumnTest.php.

References $result, and array.

139  {
140  $attributeSet = array( 'val' => 100,
141  'maxVal' => 200
142  );
143 
144  foreach($attributeSet as $attributeName => $attributeValue) {
145  // Setters return the instance to implement the fluent interface
146  $result = $this->_testAutoFilterColumnObject->setAttribute($attributeName,$attributeValue);
147  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
148  }
149  }
$result
Create styles array
The data for the language used.

◆ testSetAttributes()

AutofilterColumnTest::testSetAttributes ( )

Definition at line 114 of file ColumnTest.php.

References $result, and array.

115  {
116  $attributeSet = array( 'val' => 100,
117  'maxVal' => 200
118  );
119 
120  // Setters return the instance to implement the fluent interface
121  $result = $this->_testAutoFilterColumnObject->setAttributes($attributeSet);
122  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
123  }
$result
Create styles array
The data for the language used.

◆ testSetColumnIndex()

AutofilterColumnTest::testSetColumnIndex ( )

Definition at line 39 of file ColumnTest.php.

References $result.

40  {
41  $expectedResult = 'L';
42 
43  // Setters return the instance to implement the fluent interface
44  $result = $this->_testAutoFilterColumnObject->setColumnIndex($expectedResult);
45  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
46 
47  $result = $this->_testAutoFilterColumnObject->getColumnIndex();
48  $this->assertEquals($expectedResult, $result);
49  }
$result

◆ testSetFilterType()

AutofilterColumnTest::testSetFilterType ( )

Definition at line 70 of file ColumnTest.php.

References $result, and PHPExcel_Worksheet_AutoFilter_Column\AUTOFILTER_FILTERTYPE_DYNAMICFILTER.

71  {
72  $result = $this->_testAutoFilterColumnObject->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER);
73  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
74 
75  $result = $this->_testAutoFilterColumnObject->getFilterType();
77  }
$result

◆ testSetInvalidFilterTypeThrowsException()

AutofilterColumnTest::testSetInvalidFilterTypeThrowsException ( )

PHPExcel_Exception

Definition at line 82 of file ColumnTest.php.

References $result.

83  {
84  $expectedResult = 'Unfiltered';
85 
86  $result = $this->_testAutoFilterColumnObject->setFilterType($expectedResult);
87  }
$result

◆ testSetInvalidJoinThrowsException()

AutofilterColumnTest::testSetInvalidJoinThrowsException ( )

PHPExcel_Exception

Definition at line 107 of file ColumnTest.php.

References $result.

108  {
109  $expectedResult = 'Neither';
110 
111  $result = $this->_testAutoFilterColumnObject->setJoin($expectedResult);
112  }
$result

◆ testSetJoin()

AutofilterColumnTest::testSetJoin ( )

Definition at line 95 of file ColumnTest.php.

References $result, and PHPExcel_Worksheet_AutoFilter_Column\AUTOFILTER_COLUMN_JOIN_AND.

96  {
97  $result = $this->_testAutoFilterColumnObject->setJoin(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND);
98  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
99 
100  $result = $this->_testAutoFilterColumnObject->getJoin();
102  }
$result

◆ testSetParent()

AutofilterColumnTest::testSetParent ( )

Definition at line 57 of file ColumnTest.php.

References $result.

58  {
59  // Setters return the instance to implement the fluent interface
60  $result = $this->_testAutoFilterColumnObject->setParent($this->_mockAutoFilterObject);
61  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
62  }
$result

Field Documentation

◆ $_mockAutoFilterObject

AutofilterColumnTest::$_mockAutoFilterObject
private

Definition at line 10 of file ColumnTest.php.

◆ $_testAutoFilterColumnObject

AutofilterColumnTest::$_testAutoFilterColumnObject
private

Definition at line 8 of file ColumnTest.php.

Referenced by testClone().

◆ $_testInitialColumn

AutofilterColumnTest::$_testInitialColumn = 'H'
private

Definition at line 6 of file ColumnTest.php.


The documentation for this class was generated from the following file: