ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
RuleTest.php
Go to the documentation of this file.
1 <?php
2 
3 
5 {
7 
9 
10  public function setUp()
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  }
29 
30  public function testGetRuleType()
31  {
32  $result = $this->_testAutoFilterRuleObject->getRuleType();
34  }
35 
36  public function testSetRuleType()
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  }
47 
48  public function testSetValue()
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  }
59 
60  public function testGetOperator()
61  {
62  $result = $this->_testAutoFilterRuleObject->getOperator();
64  }
65 
66  public function testSetOperator()
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  }
77 
78  public function testSetGrouping()
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  }
89 
90  public function testGetParent()
91  {
92  $result = $this->_testAutoFilterRuleObject->getParent();
93  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
94  }
95 
96  public function testSetParent()
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  }
102 
103  public function testClone()
104  {
106  $this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);
107  }
108 
109 }
testSetOperator()
Definition: RuleTest.php:66
$result
testGetRuleType()
Definition: RuleTest.php:30
$_testAutoFilterRuleObject
Definition: RuleTest.php:6
testSetGrouping()
Definition: RuleTest.php:78
$_mockAutoFilterColumnObject
Definition: RuleTest.php:8
testSetRuleType()
Definition: RuleTest.php:36
testGetOperator()
Definition: RuleTest.php:60
testSetValue()
Definition: RuleTest.php:48
testClone()
Definition: RuleTest.php:103
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
testSetParent()
Definition: RuleTest.php:96
testGetParent()
Definition: RuleTest.php:90