Files
MarkBaker a91dd60a98 Refactor unit tests to ensure that assertions are in the actual test, and not in an abstract class; and that setup/teardown are in the test and not an abstract. This means that assertions and setup/teardown are always in the file when reviewing PRs.
Also enforce more rigorous Excel Function implementation by testing the underlying implementation, call via the Calc Engine, and execution from in a worksheet.
Separate out unhappy path (exception) checks into a separate test, so that a single test isn't made overcomplex checking for every potentiality.

Scrutinizer may dislike variadics, for variable number of arguments of mixed type; but tough. It's 100% valid PHP, accepted by phpstan, and makes life a lot easier.

Initial work here covers all the database and datetime unit tests for Excel function implementations.
2023-03-10 04:15:12 +01:00

35 lines
661 B
PHP

<?php
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
return [
[51, '21-Dec-2000'],
[52, '2000-01-01'],
[1, '2000-01-03'],
[52, '1995-01-01'],
[1, '1995-01-07'],
[2, '1995-01-10'],
[1, '2018-01-01'],
[ExcelError::VALUE(), '1800-01-01'],
[52, false],
[52, true],
[52, 0],
[52, 1],
[1, 2],
[1, 8],
[2, 9],
[53, '1904-01-01'],
[52, '1900-01-01'],
[1, '1900-01-07'],
[1, '1900-01-08'],
[2, '1900-01-09'],
[9, '1900-03-04'],
[10, '1900-03-05'],
[ExcelError::NAN(), -1],
[39, 1000],
[25, '2001'],
[25, 2002],
[25, 2003],
[26, 2004],
];