AccrintTest.php 800 B

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