mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-25 10:58:18 +00:00
ec4098c8fd
While we might never be able to have 100% of our code strict, we can at the very least do it for all of our tests. This ensures that our tests are using our API with the types as intended by the test author, and not silently be cast to what our API requires.
33 lines
945 B
PHP
33 lines
945 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig;
|
|
|
|
class MInverseTest extends AllSetupTeardown
|
|
{
|
|
/**
|
|
* @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());
|
|
}
|
|
}
|