Files
PhpSpreadsheet/tests/PhpSpreadsheetTests/Helper/HtmlTest.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
775 B
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Helper;
use PhpOffice\PhpSpreadsheet\Helper\Html;
use PHPUnit\Framework\TestCase;
class HtmlTest extends TestCase
{
/**
* @dataProvider providerUtf8EncodingSupport
*/
public function testUtf8EncodingSupport(mixed $expected, mixed $input): void
{
$html = new Html();
$actual = $html->toRichTextObject($input);
self::assertSame($expected, $actual->getPlainText());
}
public static function providerUtf8EncodingSupport(): array
{
return [
['foo', 'foo'],
['können', 'können'],
['русский', 'русский'],
["foo\nbar", '<p>foo</p><p>bar</p>'],
'issue2810' => ['0', '0'],
];
}
}