Files
PhpSpreadsheet/tests/PhpSpreadsheetTests/Reader/Xls/ErrorCodeMapTest.php
T
Adrien Crivelli 1b05dfab8b Rector AddParamTypeBasedOnPHPUnitDataProviderRector
And quite a bit more manual changes. The idea is that typing of our
tests can be a bit more loose, so we assume PHPDoc is mostly correct. If
that happens to be wrong, it should be caught by the tests themselves.
2023-09-07 17:00:24 +08:00

32 lines
730 B
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Reader\Xls;
use PhpOffice\PhpSpreadsheet\Reader\Xls\ErrorCode;
use PHPUnit\Framework\TestCase;
class ErrorCodeMapTest extends TestCase
{
/**
* @dataProvider errorCodeMapProvider
*/
public function testErrorCode(bool|string $expected, int $index): void
{
self::assertSame($expected, ErrorCode::lookup($index));
}
public static function errorCodeMapProvider(): array
{
return [
[false, 0x01],
['#NULL!', 0x00],
['#DIV/0!', 0x07],
['#VALUE!', 0x0F],
['#REF!', 0x17],
['#NAME?', 0x1d],
['#NUM!', 0x24],
['#N/A', 0x2a],
];
}
}