TrimMeanTest.php 872 B

1234567891011121314151617181920212223242526272829303132
  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 TrimMeanTest extends TestCase
  7. {
  8. protected function setUp(): void
  9. {
  10. Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
  11. }
  12. /**
  13. * @dataProvider providerTRIMMEAN
  14. *
  15. * @param mixed $expectedResult
  16. * @param mixed $percentage
  17. */
  18. public function testTRIMMEAN($expectedResult, array $args, $percentage): void
  19. {
  20. $result = Statistical::TRIMMEAN($args, $percentage);
  21. self::assertEqualsWithDelta($expectedResult, $result, 1E-12);
  22. }
  23. public function providerTRIMMEAN(): array
  24. {
  25. return require 'tests/data/Calculation/Statistical/TRIMMEAN.php';
  26. }
  27. }