Files
oleibman 704a7b9fd1 Fix Unintential Deprecated Calls in Tests - LOOKUPREF (#3174)
* Fix Unintential Deprecated Calls in Tests - LOOKUPREF

I think it's best to install these before PR #3166. There are no changes to source code, only to test members which continue to inadvertently use calls to deprecated functions.

* Fix deprecation DocBlocks

Deprecated->deprecated, adjust see and comments

* One Intentional Deprecation

Annotate it.
2022-11-21 19:54:14 -08:00

58 lines
1.4 KiB
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef;
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
use PHPUnit\Framework\TestCase;
class ColumnsTest extends TestCase
{
/**
* @dataProvider providerCOLUMNS
*
* @param mixed $expectedResult
* @param null|array|string $arg
*/
public function testCOLUMNS($expectedResult, $arg): void
{
$result = LookupRef\RowColumnInformation::COLUMNS($arg);
self::assertEquals($expectedResult, $result);
}
public function providerCOLUMNS(): array
{
return require 'tests/data/Calculation/LookupRef/COLUMNS.php';
}
/**
* @dataProvider providerColumnsArray
*/
public function testColumnsArray(int $expectedResult, string $argument): void
{
$calculation = Calculation::getInstance();
$formula = "=COLUMNS({$argument})";
$result = $calculation->_calculateFormulaValue($formula);
self::assertEquals($expectedResult, $result);
}
public function providerColumnsArray(): array
{
return [
[
3,
'{1,2,3;4,5,6}',
],
[
5,
'{1,2,3,4,5}',
],
[
1,
'{1;2;3;4;5}',
],
];
}
}