diff --git a/src/PhpSpreadsheet/Calculation/TextData.php b/src/PhpSpreadsheet/Calculation/TextData.php index d03c4983..050c1a9b 100644 --- a/src/PhpSpreadsheet/Calculation/TextData.php +++ b/src/PhpSpreadsheet/Calculation/TextData.php @@ -87,7 +87,7 @@ class TextData private static function convertBooleanValue($value) { if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) { - return (int)$value; + return (int) $value; } return ($value) ? Calculation::getTRUE() : Calculation::getFALSE(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ChooseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ChooseTest.php new file mode 100644 index 00000000..c1e043e0 --- /dev/null +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ChooseTest.php @@ -0,0 +1,31 @@ +assertEquals($expectedResult, $result); + } + + public function providerCHOOSE() + { + return require 'data/Calculation/LookupRef/CHOOSE.php'; + } +} diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsTest.php new file mode 100644 index 00000000..06872eec --- /dev/null +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsTest.php @@ -0,0 +1,31 @@ +assertEquals($expectedResult, $result); + } + + public function providerCOLUMNS() + { + return require 'data/Calculation/LookupRef/COLUMNS.php'; + } +} diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HLookupTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HLookupTest.php index 41a79621..cb1f08fa 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HLookupTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HLookupTest.php @@ -2,8 +2,8 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef; -use PhpOffice\PhpSpreadsheet\Calculation\LookupRef; use PhpOffice\PhpSpreadsheet\Calculation\Functions; +use PhpOffice\PhpSpreadsheet\Calculation\LookupRef; use PHPUnit\Framework\TestCase; class HLookupTest extends TestCase diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexTest.php new file mode 100644 index 00000000..0da7de1b --- /dev/null +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexTest.php @@ -0,0 +1,31 @@ +assertEquals($expectedResult, $result); + } + + public function providerINDEX() + { + return require 'data/Calculation/LookupRef/INDEX.php'; + } +} diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/LookupTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/LookupTest.php index 815d5b73..0c5e610e 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/LookupTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/LookupTest.php @@ -2,8 +2,8 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef; -use PhpOffice\PhpSpreadsheet\Calculation\LookupRef; use PhpOffice\PhpSpreadsheet\Calculation\Functions; +use PhpOffice\PhpSpreadsheet\Calculation\LookupRef; use PHPUnit\Framework\TestCase; class LookupTest extends TestCase diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MatchTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MatchTest.php new file mode 100644 index 00000000..42c7b3bb --- /dev/null +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MatchTest.php @@ -0,0 +1,31 @@ +assertEquals($expectedResult, $result); + } + + public function providerMATCH() + { + return require 'data/Calculation/LookupRef/MATCH.php'; + } +} diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsTest.php new file mode 100644 index 00000000..46dd9851 --- /dev/null +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsTest.php @@ -0,0 +1,31 @@ +assertEquals($expectedResult, $result); + } + + public function providerROWS() + { + return require 'data/Calculation/LookupRef/ROWS.php'; + } +} diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/VLookupTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/VLookupTest.php index 1de96dff..ea9afa20 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/VLookupTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/VLookupTest.php @@ -2,8 +2,8 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef; -use PhpOffice\PhpSpreadsheet\Calculation\LookupRef; use PhpOffice\PhpSpreadsheet\Calculation\Functions; +use PhpOffice\PhpSpreadsheet\Calculation\LookupRef; use PHPUnit\Framework\TestCase; class VLookupTest extends TestCase diff --git a/tests/PhpSpreadsheetTests/Calculation/LookupRefTest.php b/tests/PhpSpreadsheetTests/Calculation/LookupRefTest.php index 2d9b5e7b..9d7da8dd 100644 --- a/tests/PhpSpreadsheetTests/Calculation/LookupRefTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/LookupRefTest.php @@ -19,70 +19,6 @@ class LookupRefTest extends TestCase Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } - /** - * @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'; - } - /** * @dataProvider providerFormulaText * diff --git a/tests/data/Calculation/LookupRef/CHOOSE.php b/tests/data/Calculation/LookupRef/CHOOSE.php new file mode 100644 index 00000000..020ef498 --- /dev/null +++ b/tests/data/Calculation/LookupRef/CHOOSE.php @@ -0,0 +1,28 @@ +