Initial work on the ARRAYTOTEXT() Excel Function

This commit is contained in:
MarkBaker
2022-08-04 14:05:18 +02:00
parent 06d2682c5b
commit 4724c8f7e9
5 changed files with 97 additions and 2 deletions
@@ -0,0 +1,24 @@
<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\TextData;
class ArrayToTextTest extends AllSetupTeardown
{
/**
* @dataProvider providerARRAYTOTEXT
*/
public function testArrayToText(string $expectedResult, array $testData, int $mode): void
{
$worksheet = $this->getSheet();
$worksheet->fromArray($testData, null, 'A1', true);
$worksheet->getCell('H1')->setValue("=ARRAYTOTEXT(A1:C5, {$mode})");
$result = $worksheet->getCell('H1')->getCalculatedValue();
self::assertSame($expectedResult, $result);
}
public function providerARRAYTOTEXT(): array
{
return require 'tests/data/Calculation/TextData/ARRAYTOTEXT.php';
}
}