PhpSpreadsheet/tests/PhpSpreadsheetTests/Calculation/LookupRefTest.php

115 lines
2.6 KiB
PHP
Raw Normal View History

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
use PHPUnit\Framework\TestCase;
/**
2016-12-22 14:43:37 +00:00
* Class LookupRefTest.
*/
class LookupRefTest extends TestCase
{
public function setUp()
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
2015-05-17 13:00:02 +00:00
}
/**
* @dataProvider providerHLOOKUP
*
* @param mixed $expectedResult
*/
public function testHLOOKUP($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = LookupRef::HLOOKUP(...$args);
self::assertEquals($expectedResult, $result);
2015-05-17 13:00:02 +00:00
}
public function providerHLOOKUP()
{
return require 'data/Calculation/LookupRef/HLOOKUP.php';
2015-05-17 13:00:02 +00:00
}
/**
* @dataProvider providerVLOOKUP
*
* @param mixed $expectedResult
*/
public function testVLOOKUP($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = LookupRef::VLOOKUP(...$args);
self::assertEquals($expectedResult, $result);
2015-05-17 13:00:02 +00:00
}
public function providerVLOOKUP()
{
return require 'data/Calculation/LookupRef/VLOOKUP.php';
2015-05-17 13:00:02 +00:00
}
/**
* @dataProvider providerMATCH
*
* @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';
}
/**
* @dataProvider providerINDEX
*
* @param mixed $expectedResult
*/
public function testINDEX($expectedResult, ...$args)
{
$result = LookupRef::INDEX(...$args);
self::assertEquals($expectedResult, $result);
}
public function providerINDEX()
{
return require 'data/Calculation/LookupRef/INDEX.php';
}
/**
* @dataProvider providerCOLUMNS
*
* @param mixed $expectedResult
*/
public function testCOLUMNS($expectedResult, ...$args)
{
$result = LookupRef::COLUMNS(...$args);
self::assertEquals($expectedResult, $result);
}
public function providerCOLUMNS()
{
return require 'data/Calculation/LookupRef/COLUMNS.php';
}
/**
* @dataProvider providerROWS
*
* @param mixed $expectedResult
*/
public function testROWS($expectedResult, ...$args)
{
$result = LookupRef::ROWS(...$args);
self::assertEquals($expectedResult, $result);
}
public function providerROWS()
{
return require 'data/Calculation/LookupRef/ROWS.php';
}
}