Files
PhpSpreadsheet/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogEstTest.php
T
Mark Baker 2d8c8c8ecf Trend unit tests (#1899)
- Move TREND() functions into the Statistical Trends class
- Unit tests for TREND()
- Create Confidence class for Statistical Confidence functions
2021-03-06 22:50:19 +01:00

34 lines
954 B
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical;
use PHPUnit\Framework\TestCase;
class LogEstTest extends TestCase
{
/**
* @dataProvider providerLOGEST
*
* @param mixed $expectedResult
* @param mixed $xValues
* @param mixed $yValues
* @param mixed $const
* @param mixed $stats
*/
public function testLOGEST($expectedResult, $yValues, $xValues, $const, $stats): void
{
$result = Statistical::LOGEST($yValues, $xValues, $const, $stats);
//var_dump($result);
$elements = count($expectedResult);
for ($element = 0; $element < $elements; ++$element) {
self::assertEqualsWithDelta($expectedResult[$element], $result[$element], 1E-12);
}
}
public function providerLOGEST()
{
return require 'tests/data/Calculation/Statistical/LOGEST.php';
}
}