aef4d711f5
Because even if it doesn't make a difference in practice, it is technically more correct to call static methods statically. It also better advertise that those methods can be used from any context.
70 lines
1.6 KiB
PHP
70 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Calculation;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
|
|
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
|
|
use PHPUnit_Framework_TestCase;
|
|
|
|
/**
|
|
* Class LookupRefTest.
|
|
*/
|
|
class LookupRefTest extends PHPUnit_Framework_TestCase
|
|
{
|
|
public function setUp()
|
|
{
|
|
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
|
|
}
|
|
|
|
/**
|
|
* @dataProvider providerHLOOKUP
|
|
* @group fail19
|
|
*
|
|
* @param mixed $expectedResult
|
|
*/
|
|
public function testHLOOKUP($expectedResult, ...$args)
|
|
{
|
|
$result = LookupRef::HLOOKUP(...$args);
|
|
self::assertEquals($expectedResult, $result);
|
|
}
|
|
|
|
public function providerHLOOKUP()
|
|
{
|
|
return require 'data/Calculation/LookupRef/HLOOKUP.php';
|
|
}
|
|
|
|
/**
|
|
* @dataProvider providerVLOOKUP
|
|
* @group fail19
|
|
*
|
|
* @param mixed $expectedResult
|
|
*/
|
|
public function testVLOOKUP($expectedResult, ...$args)
|
|
{
|
|
$result = LookupRef::VLOOKUP(...$args);
|
|
self::assertEquals($expectedResult, $result);
|
|
}
|
|
|
|
public function providerVLOOKUP()
|
|
{
|
|
return require 'data/Calculation/LookupRef/VLOOKUP.php';
|
|
}
|
|
|
|
/**
|
|
* @dataProvider providerMATCH
|
|
* @group fail19
|
|
*
|
|
* @param mixed $expectedResult
|
|
*/
|
|
public function testMATCH($expectedResult, ...$args)
|
|
{
|
|
$result = LookupRef::MATCH(...$args);
|
|
self::assertEquals($expectedResult, $result);
|
|
}
|
|
|
|
public function providerMATCH()
|
|
{
|
|
return require 'data/Calculation/LookupRef/MATCH.php';
|
|
}
|
|
}
|