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

Public Member Functions

 setUp ()
 
 testGetRuleType ()
 
 testSetRuleType ()
 
 testSetValue ()
 
 testGetOperator ()
 
 testSetOperator ()
 
 testSetGrouping ()
 
 testGetParent ()
 
 testSetParent ()
 
 testClone ()
 

Private Attributes

 $_testAutoFilterRuleObject
 
 $_mockAutoFilterColumnObject
 

Detailed Description

Definition at line 4 of file RuleTest.php.

Member Function Documentation

◆ setUp()

RuleTest::setUp ( )

Definition at line 10 of file RuleTest.php.

References defined.

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

◆ testClone()

RuleTest::testClone ( )

Definition at line 103 of file RuleTest.php.

References $_testAutoFilterRuleObject, and $result.

104  {
106  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);
107  }
$result
$_testAutoFilterRuleObject
Definition: RuleTest.php:6

◆ testGetOperator()

RuleTest::testGetOperator ( )

Definition at line 60 of file RuleTest.php.

References $result, and PHPExcel_Worksheet_AutoFilter_Column_Rule\AUTOFILTER_COLUMN_RULE_EQUAL.

61  {
62  $result = $this->_testAutoFilterRuleObject->getOperator();
64  }
$result

◆ testGetParent()

RuleTest::testGetParent ( )

Definition at line 90 of file RuleTest.php.

References $result.

91  {
92  $result = $this->_testAutoFilterRuleObject->getParent();
93  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
94  }
$result

◆ testGetRuleType()

RuleTest::testGetRuleType ( )

Definition at line 30 of file RuleTest.php.

References $result, and PHPExcel_Worksheet_AutoFilter_Column_Rule\AUTOFILTER_RULETYPE_FILTER.

31  {
32  $result = $this->_testAutoFilterRuleObject->getRuleType();
34  }
$result

◆ testSetGrouping()

RuleTest::testSetGrouping ( )

Definition at line 78 of file RuleTest.php.

References $result, and PHPExcel_Worksheet_AutoFilter_Column_Rule\AUTOFILTER_RULETYPE_DATEGROUP_MONTH.

79  {
81 
82  // Setters return the instance to implement the fluent interface
83  $result = $this->_testAutoFilterRuleObject->setGrouping($expectedResult);
84  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);
85 
86  $result = $this->_testAutoFilterRuleObject->getGrouping();
87  $this->assertEquals($expectedResult, $result);
88  }
$result

◆ testSetOperator()

RuleTest::testSetOperator ( )

Definition at line 66 of file RuleTest.php.

References $result, and PHPExcel_Worksheet_AutoFilter_Column_Rule\AUTOFILTER_COLUMN_RULE_LESSTHAN.

67  {
69 
70  // Setters return the instance to implement the fluent interface
71  $result = $this->_testAutoFilterRuleObject->setOperator($expectedResult);
72  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);
73 
74  $result = $this->_testAutoFilterRuleObject->getOperator();
75  $this->assertEquals($expectedResult, $result);
76  }
$result

◆ testSetParent()

RuleTest::testSetParent ( )

Definition at line 96 of file RuleTest.php.

References $result.

97  {
98  // Setters return the instance to implement the fluent interface
99  $result = $this->_testAutoFilterRuleObject->setParent($this->_mockAutoFilterColumnObject);
100  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);
101  }
$result

◆ testSetRuleType()

RuleTest::testSetRuleType ( )

Definition at line 36 of file RuleTest.php.

References $result, and PHPExcel_Worksheet_AutoFilter_Column_Rule\AUTOFILTER_RULETYPE_DATEGROUP.

37  {
39 
40  // Setters return the instance to implement the fluent interface
41  $result = $this->_testAutoFilterRuleObject->setRuleType($expectedResult);
42  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);
43 
44  $result = $this->_testAutoFilterRuleObject->getRuleType();
45  $this->assertEquals($expectedResult, $result);
46  }
$result

◆ testSetValue()

RuleTest::testSetValue ( )

Definition at line 48 of file RuleTest.php.

References $result.

49  {
50  $expectedResult = 100;
51 
52  // Setters return the instance to implement the fluent interface
53  $result = $this->_testAutoFilterRuleObject->setValue($expectedResult);
54  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);
55 
56  $result = $this->_testAutoFilterRuleObject->getValue();
57  $this->assertEquals($expectedResult, $result);
58  }
$result

Field Documentation

◆ $_mockAutoFilterColumnObject

RuleTest::$_mockAutoFilterColumnObject
private

Definition at line 8 of file RuleTest.php.

◆ $_testAutoFilterRuleObject

RuleTest::$_testAutoFilterRuleObject
private

Definition at line 6 of file RuleTest.php.

Referenced by testClone().


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