mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-25 05:18:17 +00:00
ac5299b5df
* Minor Fix for AND/OR/XOR These 3 fall into the set of functions where Excel treats string literals differently depending on whether they are passed to the function directly or as a cell reference. PhpSpreadsheet is updated to try to duplicate that logic. New tests are added. Some existing test results had to change as a result of this code change. * Adopt A Suggestion From Mark Baker Reduce if statements by adding functions.
120 lines
1.6 KiB
PHP
120 lines
1.6 KiB
PHP
<?php
|
|
|
|
return [
|
|
'no arguments' => [
|
|
'exception',
|
|
],
|
|
'only argument is null reference' => [
|
|
'#VALUE!',
|
|
null,
|
|
],
|
|
// Boolean TRUE and NULL
|
|
[
|
|
true,
|
|
true,
|
|
null,
|
|
],
|
|
// Boolean FALSE and NULL
|
|
[
|
|
false,
|
|
false,
|
|
null,
|
|
],
|
|
// Both TRUE Booleans
|
|
[
|
|
true,
|
|
true,
|
|
true,
|
|
],
|
|
// Mixed Booleans
|
|
[
|
|
false,
|
|
true,
|
|
false,
|
|
],
|
|
// Mixed Booleans
|
|
[
|
|
false,
|
|
false,
|
|
true,
|
|
],
|
|
// Both FALSE Booleans
|
|
[
|
|
false,
|
|
false,
|
|
false,
|
|
],
|
|
// Multiple Mixed Booleans
|
|
[
|
|
false,
|
|
true,
|
|
true,
|
|
false,
|
|
],
|
|
// Multiple TRUE Booleans
|
|
[
|
|
true,
|
|
true,
|
|
true,
|
|
true,
|
|
],
|
|
// Multiple FALSE Booleans
|
|
[
|
|
false,
|
|
false,
|
|
false,
|
|
false,
|
|
false,
|
|
],
|
|
[
|
|
true,
|
|
-1,
|
|
-2,
|
|
],
|
|
[
|
|
false,
|
|
0,
|
|
0,
|
|
],
|
|
[
|
|
false,
|
|
0,
|
|
1,
|
|
],
|
|
[
|
|
true,
|
|
1,
|
|
1,
|
|
],
|
|
'string 1 is ignored' => [
|
|
true,
|
|
'1',
|
|
1,
|
|
],
|
|
'true string is ignored' => [
|
|
true,
|
|
'TRUE',
|
|
1,
|
|
],
|
|
'false string is ignored' => [
|
|
true,
|
|
'FALSE',
|
|
true,
|
|
],
|
|
'non-boolean string is ignored' => [
|
|
false,
|
|
'ABCD',
|
|
0,
|
|
],
|
|
[
|
|
true,
|
|
-2,
|
|
1,
|
|
],
|
|
[
|
|
false,
|
|
-2,
|
|
0,
|
|
],
|
|
];
|