mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-21 15:49:26 +00:00
28 lines
830 B
PHP
28 lines
830 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\TextData;
|
|
|
|
use PHPUnit\Framework\Attributes\DataProvider;
|
|
|
|
class ArrayToTextTest extends AllSetupTeardown
|
|
{
|
|
/** @param mixed[] $testData */
|
|
#[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 static function providerARRAYTOTEXT(): array
|
|
{
|
|
return require 'tests/data/Calculation/TextData/ARRAYTOTEXT.php';
|
|
}
|
|
}
|