| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Engineering;
- use PhpOffice\PhpSpreadsheet\Calculation\Engineering;
- use PhpOffice\PhpSpreadsheet\Calculation\Functions;
- use PhpOffice\PhpSpreadsheetTests\Custom\ComplexAssert;
- use PHPUnit\Framework\TestCase;
- class ImSumTest extends TestCase
- {
- const COMPLEX_PRECISION = 1E-8;
- /**
- * @var ComplexAssert
- */
- private $complexAssert;
- protected function setUp(): void
- {
- Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
- $this->complexAssert = new ComplexAssert();
- }
- /**
- * @dataProvider providerIMSUM
- *
- * @param mixed $expectedResult
- */
- public function testIMSUM($expectedResult, ...$args): void
- {
- $result = Engineering::IMSUM(...$args);
- self::assertTrue(
- $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
- $this->complexAssert->getErrorMessage()
- );
- }
- public function providerIMSUM(): array
- {
- return require 'tests/data/Calculation/Engineering/IMSUM.php';
- }
- }
|