Files
PhpSpreadsheet/tests/PhpSpreadsheetTests/Calculation/Functions/Information/InfoTest.php
T
Robin van der Vliet e929a94ef6 Fix tests
2025-11-11 23:17:46 +01:00

29 lines
787 B
PHP

<?php
declare(strict_types=1);
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Information;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PHPUnit\Framework\TestCase;
class InfoTest extends TestCase
{
#[\PHPUnit\Framework\Attributes\DataProvider('providerINFO')]
public function testINFO(mixed $expectedResult, string $typeText): void
{
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->getCell('A1')->setValue('=INFO("' . $typeText . '")');
$result = $sheet->getCell('A1')->getCalculatedValue();
self::assertEquals($expectedResult, $result);
}
public static function providerINFO(): array
{
return require 'tests/data/Calculation/Information/INFO.php';
}
}