33 lines
942 B
PHP
33 lines
942 B
PHP
<?php
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig;
|
|
|
|
class MInverseTest extends AllSetupTeardown
|
|
{
|
|
/**
|
|
* @dataProvider providerMINVERSE
|
|
*
|
|
* @param mixed $expectedResult
|
|
*/
|
|
public function testMINVERSE($expectedResult, array $args): void
|
|
{
|
|
$result = MathTrig\MatrixFunctions::funcMInverse($args);
|
|
self::assertEqualsWithDelta($expectedResult, $result, 1E-8);
|
|
}
|
|
|
|
public function providerMINVERSE()
|
|
{
|
|
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->sheet;
|
|
$sheet->getCell('A1')->setValue('=MINVERSE({1,2,3})'); // not square
|
|
self::assertSame('#VALUE!', $sheet->getCell('A1')->getCalculatedValue());
|
|
}
|
|
}
|