mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-10-09 05:16:18 +00:00
1b05dfab8b
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.
32 lines
775 B
PHP
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'],
|
|
];
|
|
}
|
|
}
|