ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
AutofilterColumnTest Class Reference
+ Inheritance diagram for AutofilterColumnTest:
+ Collaboration diagram for AutofilterColumnTest:

Public Member Functions

 setUp ()
 
 testGetColumnIndex ()
 
 testSetColumnIndex ()
 
 testGetParent ()
 
 testSetParent ()
 
 testGetFilterType ()
 
 testSetFilterType ()
 
 testSetInvalidFilterTypeThrowsException ()
 @expectedException PHPExcel_Exception More...
 
 testGetJoin ()
 
 testSetJoin ()
 
 testSetInvalidJoinThrowsException ()
 @expectedException 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.

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

References defined.

◆ testClone()

AutofilterColumnTest::testClone ( )

Definition at line 167 of file ColumnTest.php.

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

References $_testAutoFilterColumnObject, and $result.

◆ testGetAttribute()

AutofilterColumnTest::testGetAttribute ( )

Definition at line 151 of file ColumnTest.php.

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 }

References $result.

◆ testGetAttributes()

AutofilterColumnTest::testGetAttributes ( )

Definition at line 125 of file ColumnTest.php.

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 }

References $result.

◆ testGetColumnIndex()

AutofilterColumnTest::testGetColumnIndex ( )

Definition at line 33 of file ColumnTest.php.

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

References $result.

◆ testGetFilterType()

AutofilterColumnTest::testGetFilterType ( )

Definition at line 64 of file ColumnTest.php.

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

References $result, and PHPExcel_Worksheet_AutoFilter_Column\AUTOFILTER_FILTERTYPE_FILTER.

◆ testGetJoin()

AutofilterColumnTest::testGetJoin ( )

Definition at line 89 of file ColumnTest.php.

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

References $result, and PHPExcel_Worksheet_AutoFilter_Column\AUTOFILTER_COLUMN_JOIN_OR.

◆ testGetParent()

AutofilterColumnTest::testGetParent ( )

Definition at line 51 of file ColumnTest.php.

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

References $result.

◆ testSetAttribute()

AutofilterColumnTest::testSetAttribute ( )

Definition at line 138 of file ColumnTest.php.

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 }

References $result.

◆ testSetAttributes()

AutofilterColumnTest::testSetAttributes ( )

Definition at line 114 of file ColumnTest.php.

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 }

References $result.

◆ testSetColumnIndex()

AutofilterColumnTest::testSetColumnIndex ( )

Definition at line 39 of file ColumnTest.php.

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 }

References $result.

◆ testSetFilterType()

AutofilterColumnTest::testSetFilterType ( )

Definition at line 70 of file ColumnTest.php.

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 }

References $result, and PHPExcel_Worksheet_AutoFilter_Column\AUTOFILTER_FILTERTYPE_DYNAMICFILTER.

◆ testSetInvalidFilterTypeThrowsException()

AutofilterColumnTest::testSetInvalidFilterTypeThrowsException ( )

@expectedException PHPExcel_Exception

Definition at line 82 of file ColumnTest.php.

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

References $result.

◆ testSetInvalidJoinThrowsException()

AutofilterColumnTest::testSetInvalidJoinThrowsException ( )

@expectedException PHPExcel_Exception

Definition at line 107 of file ColumnTest.php.

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

References $result.

◆ testSetJoin()

AutofilterColumnTest::testSetJoin ( )

Definition at line 95 of file ColumnTest.php.

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 }

References $result, and PHPExcel_Worksheet_AutoFilter_Column\AUTOFILTER_COLUMN_JOIN_AND.

◆ testSetParent()

AutofilterColumnTest::testSetParent ( )

Definition at line 57 of file ColumnTest.php.

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 }

References $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: