Files
PhpSpreadsheet/tests/data/Calculation/DateTime/NETWORKDAYS.php
T
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

36 lines
1.4 KiB
PHP

<?php
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
return [
[8, '1-Jan-2007', '10-Jan-2007'],
[3, '18-Jun-2008', '20-Jun-2008'],
[5, '16-Jun-2008', '20-Jun-2008'],
[5, '14-Jun-2008', '20-Jun-2008'],
[1, '20-Jun-2008', '20-Jun-2008'],
[0, '21-Jun-2008', '21-Jun-2008'],
[0, '20-Jun-2008', '20-Jun-2008', ['20-Jun-2008']],
[0, '20-Jun-2008', '20-Jun-2008', ['20-Jun-2008', '20-Jun-2008']],
[8, '14-Jun-2008', '25-Jun-2008'],
[17, '19-Dec-1960', '10-Jan-1961'],
[-17, '10-Jan-1961', '19-Dec-1960'],
[16, '19-Dec-1960', '10-Jan-1961', ['25-Dec-1960', '26-Dec-1960', '01-Jan-1961']],
[-16, '10-Jan-1961', '19-Dec-1960', ['25-Dec-1960', '26-Dec-1960', '01-Jan-1961']],
[65, '1-Jan-2007', '31-Mar-2007'],
[23, '1-Jan-2007', '31-Jan-2007'],
[24, '1-Jan-2007', '1-Feb-2007'],
[43, '1-Jan-2007', '28-Feb-2007'],
[2, '31-Jan-2007', '1-Feb-2007'],
[ExcelError::VALUE(), 'ABQZ', '1-Feb-2007'],
[ExcelError::VALUE(), '1-Feb-2007', 'ABQZ'],
[10, '2021-02-13', '2021-02-27'],
[10, '2021-02-14', '2021-02-27'],
[3, '2021-02-14', '2021-02-17'],
[8, '2021-02-14', '2021-02-24'],
[9, '2021-02-14', '2021-02-25'],
[10, '2021-02-14', '2021-02-26'],
[9, '2021-02-13', '2021-02-25'],
[10, '2021-02-12', '2021-02-25'],
[ExcelError::VALUE(), '10-Jan-1961', '19-Dec-1960', ['25-Dec-1960', 'ABQZ', '01-Jan-1961']],
];