LogicalTest.php
2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
require_once 'testDataFileIterator.php';
class LogicalTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
}
public function testTRUE()
{
$result = PHPExcel_Calculation_Logical::TRUE();
$this->assertEquals(TRUE, $result);
}
public function testFALSE()
{
$result = PHPExcel_Calculation_Logical::FALSE();
$this->assertEquals(FALSE, $result);
}
/**
* @dataProvider providerAND
*/
public function testAND()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_AND'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerAND()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/AND.data');
}
/**
* @dataProvider providerOR
*/
public function testOR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_OR'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerOR()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/OR.data');
}
/**
* @dataProvider providerNOT
*/
public function testNOT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','NOT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerNOT()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/NOT.data');
}
/**
* @dataProvider providerIF
*/
public function testIF()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','STATEMENT_IF'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerIF()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/IF.data');
}
/**
* @dataProvider providerIFERROR
*/
public function testIFERROR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','IFERROR'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerIFERROR()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/IFERROR.data');
}
}