SlopeTest.php 820 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
  3. use PhpOffice\PhpSpreadsheet\Calculation\Functions;
  4. use PhpOffice\PhpSpreadsheet\Calculation\Statistical;
  5. use PHPUnit\Framework\TestCase;
  6. class SlopeTest extends TestCase
  7. {
  8. protected function setUp(): void
  9. {
  10. Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
  11. }
  12. /**
  13. * @dataProvider providerSLOPE
  14. *
  15. * @param mixed $expectedResult
  16. */
  17. public function testSLOPE($expectedResult, array $xargs, array $yargs): void
  18. {
  19. $result = Statistical::SLOPE($xargs, $yargs);
  20. self::assertEqualsWithDelta($expectedResult, $result, 1E-12);
  21. }
  22. public function providerSLOPE(): array
  23. {
  24. return require 'tests/data/Calculation/Statistical/SLOPE.php';
  25. }
  26. }