mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-27 12:37:12 +00:00
2259de578b
* Extract LookupRef\INDEX() into index() method of LookupRef\Matrix class Additional tests * Bugfix for returning a column using INDEX() * Some improvements to ROW() and COLUMN() * Simplify some of the INDEX() logic, eliminating redundant code
33 lines
794 B
PHP
33 lines
794 B
PHP
<?php
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
|
|
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class IndexTest extends TestCase
|
|
{
|
|
protected function setUp(): void
|
|
{
|
|
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
|
|
}
|
|
|
|
/**
|
|
* @dataProvider providerINDEX
|
|
*
|
|
* @param mixed $expectedResult
|
|
*/
|
|
public function testINDEX($expectedResult, ...$args): void
|
|
{
|
|
$result = LookupRef::INDEX(...$args);
|
|
// var_dump($result);
|
|
self::assertEquals($expectedResult, $result);
|
|
}
|
|
|
|
public function providerINDEX()
|
|
{
|
|
return require 'tests/data/Calculation/LookupRef/INDEX.php';
|
|
}
|
|
}
|