Files
PhpSpreadsheet/tests/data/Calculation/Logical/ANDLiteral.php
T
oleibman ac5299b5df Minor Fix for AND/OR/XOR (#3287)
* 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.
2023-01-16 05:35:28 -08:00

21 lines
870 B
PHP

<?php
return [
'both boolean true' => [true, 'true, true'],
'boolean and string-true' => [true, 'true, "true"'],
'true and non-boolean-string' => [true, 'true, "xyz"'],
'non-boolean-string and true' => [true, '"xyz", true'],
'empty-string and true' => [true, '"", true'],
'non-boolean-string and false' => [false, 'false, "xyz"'],
'false and non-boolean-string' => [false, '"xyz", false'],
'only non-boolean-string' => ['#VALUE!', '"xyz"'],
'only boolean-string' => [true, '"true"'],
'numeric-true and true' => [true, '3.1, true, true'],
'numeric-false and true' => [false, '0, true, true'],
'mixed boolean' => [false, 'true, true, true, false'],
'only true' => [true, 'true'],
'only false' => [false, 0.0],
'boolean in array' => [true, '{true}'],
'boolean-string in array' => ['#VALUE!', '{"true"}'],
];