mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-20 06:50:43 +00:00
ec4098c8fd
While we might never be able to have 100% of our code strict, we can at the very least do it for all of our tests. This ensures that our tests are using our API with the types as intended by the test author, and not silently be cast to what our API requires.
63 lines
1.3 KiB
PHP
63 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
return [
|
|
[
|
|
1234567.89,
|
|
'1,234,567.890',
|
|
],
|
|
[
|
|
1234567.89,
|
|
'1 234 567,890', ',', ' ',
|
|
],
|
|
[
|
|
-1234567.89,
|
|
'-1 234 567,890', ',', ' ',
|
|
],
|
|
[
|
|
'#VALUE!',
|
|
'1 234 567,890-', ',', ' ',
|
|
],
|
|
[
|
|
'#VALUE!',
|
|
'1,234,567.890,123',
|
|
],
|
|
[
|
|
'#VALUE!',
|
|
'1.234.567.890,123',
|
|
],
|
|
[
|
|
1234567.890,
|
|
'1.234.567,890', ',', '.',
|
|
],
|
|
[
|
|
'#VALUE!',
|
|
'1.234.567,89',
|
|
],
|
|
[
|
|
12345.6789,
|
|
'1,234,567.89%',
|
|
],
|
|
[
|
|
123.456789,
|
|
'1,234,567.89%%',
|
|
],
|
|
[
|
|
1.23456789,
|
|
'1,234,567.89%%%',
|
|
],
|
|
[
|
|
'#VALUE!',
|
|
'1,234,567.89-%',
|
|
],
|
|
'no arguments' => ['exception'],
|
|
'boolean argument' => ['#VALUE!', true],
|
|
'slash as group separator' => [1234567.1, '1/234/567.1', '.', '/'],
|
|
'slash as decimal separator' => [1234567.1, '1,234,567/1', '/', ','],
|
|
'issue 3574 null string treated as 0' => [0, '', ',', ' '],
|
|
'issue 3574 one or more spaces treated as 0' => [0, ' ', ',', ' '],
|
|
'issue 3574 non-blank numeric string okay' => [2, ' 2 ', ',', ' '],
|
|
'issue 3574 non-blank non-numeric string invalid' => ['#VALUE!', ' x ', ',', ' '],
|
|
];
|