DollarFrTest.php 843 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
  3. use PhpOffice\PhpSpreadsheet\Calculation\Financial;
  4. use PHPUnit\Framework\TestCase;
  5. class DollarFrTest extends TestCase
  6. {
  7. /**
  8. * @dataProvider providerDOLLARFR
  9. *
  10. * @param mixed $expectedResult
  11. */
  12. public function testDOLLARFR($expectedResult, ...$args): void
  13. {
  14. if (count($args) === 0) {
  15. $result = Financial::DOLLARFR();
  16. } elseif (count($args) === 1) {
  17. $result = Financial::DOLLARFR($args[0]);
  18. } else {
  19. $result = Financial::DOLLARFR($args[0], $args[1]);
  20. }
  21. self::assertEqualsWithDelta($expectedResult, $result, 1E-8);
  22. }
  23. public function providerDOLLARFR(): array
  24. {
  25. return require 'tests/data/Calculation/Financial/DOLLARFR.php';
  26. }
  27. }