mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-24 01:00:05 +00:00
Clean Up Some Engineering Tests
This came to light while cleaning up ComplexAssert. Many tests are calling `_calculateFormulaValue` rather than `calculateFormula`, and, as a result, have to be trimmed before asserting. This PR changes those calls, and does a bit more to simplify the tests. There are a lot of other non-Engineering tests which call `_calculateFormulaValue`, but none of those need to manipulate the result after the test. This PR changes only tests, no source code.
This commit is contained in:
@@ -6,14 +6,15 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ArrayFormulaTest extends TestCase
|
||||
{
|
||||
#[\PHPUnit\Framework\Attributes\DataProvider('providerArrayFormulae')]
|
||||
#[DataProvider('providerArrayFormulae')]
|
||||
public function testArrayFormula(string $formula, mixed $expectedResult): void
|
||||
{
|
||||
$result = Calculation::getInstance()->_calculateFormulaValue($formula);
|
||||
$result = Calculation::getInstance()->calculateFormula($formula);
|
||||
self::assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user