mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-10-09 13:26:33 +00:00
Text function array value tests, plus some cleanup
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\TextData;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
|
||||
use PhpOffice\PhpSpreadsheet\Settings;
|
||||
|
||||
class ProperTest extends AllSetupTeardown
|
||||
@@ -64,4 +65,25 @@ class ProperTest extends AllSetupTeardown
|
||||
['Ложь', 'bg', false],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerProperArray
|
||||
*/
|
||||
public function testProperArray(array $expectedResult, string $array): void
|
||||
{
|
||||
$calculation = Calculation::getInstance();
|
||||
|
||||
$formula = "=PROPER({$array})";
|
||||
$result = $calculation->_calculateFormulaValue($formula);
|
||||
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-14);
|
||||
}
|
||||
|
||||
public function providerProperArray(): array
|
||||
{
|
||||
return [
|
||||
'row vector' => [[["Let's", 'All Change', 'Case']], '{"lEt\'S", "aLl chAngE", "cAsE"}'],
|
||||
'column vector' => [[["Let's"], ['All Change'], ['Case']], '{"lEt\'S"; "aLl chAngE"; "cAsE"}'],
|
||||
'matrix' => [[['Build All', 'Your Workbooks'], ['With', 'Phpspreadsheet']], '{"bUIld aLL", "yOUr WOrkBOOks"; "wiTH", "PhpSpreadsheet"}'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user