mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-16 13:06:31 +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.
34 lines
756 B
PHP
34 lines
756 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
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],
|
|
];
|
|
}
|
|
}
|