mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-11-03 17:58:04 +00:00
1b05dfab8b
And quite a bit more manual changes. The idea is that typing of our tests can be a bit more loose, so we assume PHPDoc is mostly correct. If that happens to be wrong, it should be caught by the tests themselves.
31 lines
982 B
PHP
31 lines
982 B
PHP
<?php
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;
|
|
|
|
class MdeTermTest extends AllSetupTeardown
|
|
{
|
|
/**
|
|
* @dataProvider providerMDETERM
|
|
*/
|
|
public function testMDETERM2(mixed $expectedResult, mixed $matrix): void
|
|
{
|
|
$this->mightHaveException($expectedResult);
|
|
$sheet = $this->getSheet();
|
|
if (is_array($matrix)) {
|
|
$sheet->fromArray($matrix, null, 'A1', true);
|
|
$maxCol = $sheet->getHighestColumn();
|
|
$maxRow = $sheet->getHighestRow();
|
|
$sheet->getCell('Z1')->setValue("=MDETERM(A1:$maxCol$maxRow)");
|
|
} else {
|
|
$sheet->getCell('Z1')->setValue("=MDETERM($matrix)");
|
|
}
|
|
$result = $sheet->getCell('Z1')->getCalculatedValue();
|
|
self::assertEqualsWithDelta($expectedResult, $result, 1E-12);
|
|
}
|
|
|
|
public static function providerMDETERM(): array
|
|
{
|
|
return require 'tests/data/Calculation/MathTrig/MDETERM.php';
|
|
}
|
|
}
|