mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-25 22:51:17 +00:00
5d309e982c
* Extract remaining Financial function unit tests into separate test classes for each function This makes it easier to manage unit tests if they are individual files rather than all in a single file It also provides a stepping stone toward making it easier to test Excel functions when Excel errors no longer return a string, but an actual Excel exception that can be handled more cleanly
32 lines
810 B
PHP
32 lines
810 B
PHP
<?php
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Calculation\Financial;
|
|
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class FvScheduleTest extends TestCase
|
|
{
|
|
protected function setUp(): void
|
|
{
|
|
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
|
|
}
|
|
|
|
/**
|
|
* @dataProvider providerFVSCHEDULE
|
|
*
|
|
* @param mixed $expectedResult
|
|
*/
|
|
public function testFVSCHEDULE($expectedResult, ...$args): void
|
|
{
|
|
$result = Financial::FVSCHEDULE(...$args);
|
|
self::assertEqualsWithDelta($expectedResult, $result, 1E-8);
|
|
}
|
|
|
|
public function providerFVSCHEDULE()
|
|
{
|
|
return require 'tests/data/Calculation/Financial/FVSCHEDULE.php';
|
|
}
|
|
}
|