mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-21 14:55:06 +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.
40 lines
791 B
PHP
40 lines
791 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use PhpOffice\PhpSpreadsheet\Cell\DataType;
|
|
|
|
return [
|
|
[
|
|
'ABCDEFGHIJ',
|
|
'ABCDE',
|
|
'FGHIJ',
|
|
],
|
|
[
|
|
'123',
|
|
1,
|
|
2,
|
|
3,
|
|
],
|
|
[
|
|
'Boolean-TRUE',
|
|
'Boolean',
|
|
'-',
|
|
true,
|
|
],
|
|
'no arguments' => ['exception'],
|
|
'result just fits' => [
|
|
// Note use Armenian character below to make sure chars, not bytes
|
|
str_repeat('Ԁ', DataType::MAX_STRING_LENGTH - 5) . 'ABCDE',
|
|
str_repeat('Ԁ', DataType::MAX_STRING_LENGTH - 5),
|
|
'ABCDE',
|
|
],
|
|
'result too long' => [
|
|
'#CALC!',
|
|
str_repeat('Ԁ', DataType::MAX_STRING_LENGTH - 5),
|
|
'abc',
|
|
'=A2',
|
|
],
|
|
'propagate DIV0' => ['#DIV/0!', '1', '=2/0', '3'],
|
|
];
|