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