Files
PhpSpreadsheet/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupNumTest.php
T
Mark Baker 41c8a4f1b4 Additional unit tests for previously untested financial functions (#1815)
* Additional unit tests for previously untested financial functions, and some additions to follow untested paths
* Start splitting Financial function tests out from the large FinancialTests class into individual test classes for each function
2021-01-30 18:45:31 +01:00

32 lines
792 B
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
use PhpOffice\PhpSpreadsheet\Calculation\Financial;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PHPUnit\Framework\TestCase;
class CoupNumTest extends TestCase
{
protected function setUp(): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
}
/**
* @dataProvider providerCOUPNUM
*
* @param mixed $expectedResult
*/
public function testCOUPNUM($expectedResult, ...$args): void
{
$result = Financial::COUPNUM(...$args);
self::assertEqualsWithDelta($expectedResult, $result, 1E-8);
}
public function providerCOUPNUM()
{
return require 'tests/data/Calculation/Financial/COUPNUM.php';
}
}