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

50 lines
1.3 KiB
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef;
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
use PHPUnit\Framework\TestCase;
class AddressTest extends TestCase
{
/**
* @dataProvider providerADDRESS
*
* @param mixed $expectedResult
*/
public function testADDRESS($expectedResult, ...$args): void
{
$result = LookupRef\Address::cell(...$args);
self::assertEquals($expectedResult, $result);
}
public function providerADDRESS(): array
{
return require 'tests/data/Calculation/LookupRef/ADDRESS.php';
}
/**
* @dataProvider providerAddressArray
*/
public function testAddressArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
$formula = "=ADDRESS({$argument1}, {$argument2}, 4)";
$result = $calculation->_calculateFormulaValue($formula);
self::assertEquals($expectedResult, $result);
}
public function providerAddressArray(): array
{
return [
'row/column vectors' => [
[['A1', 'B1', 'C1'], ['A2', 'B2', 'C2'], ['A3', 'B3', 'C3']],
'{1; 2; 3}',
'{1, 2, 3}',
],
];
}
}