Files
oleibman 770eddf69d Still More Prep for Phpstan 10
Remaining:
- Calculation/LookupRef
- Calculation/Statistical
- Shared/OLE
- Odds and ends
2025-05-15 08:19:39 -07:00

33 lines
1010 B
PHP

<?php
declare(strict_types=1);
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig;
use PHPUnit\Framework\Attributes\DataProvider;
class MInverseTest extends AllSetupTeardown
{
/** @param mixed[] $args */
#[DataProvider('providerMINVERSE')]
public function testMINVERSE(mixed $expectedResult, array $args): void
{
$result = MathTrig\MatrixFunctions::inverse($args);
self::assertEqualsWithDelta($expectedResult, $result, 1E-8);
}
public static function providerMINVERSE(): array
{
return require 'tests/data/Calculation/MathTrig/MINVERSE.php';
}
public function testOnSpreadsheet(): void
{
// very limited ability to test this in the absence of dynamic arrays
$sheet = $this->getSheet();
$sheet->getCell('A1')->setValue('=MINVERSE({1,2,3})'); // not square
self::assertSame('#VALUE!', $sheet->getCell('A1')->getCalculatedValue());
}
}