PhpSpreadsheet/tests/PhpSpreadsheetTests/Calculation/LookupRefTest.php

69 lines
1.5 KiB
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
/**
* 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);
$this->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);
$this->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);
$this->assertEquals($expectedResult, $result);
}
public function providerMATCH()
{
return require 'data/Calculation/LookupRef/MATCH.php';
}
}