You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
827 B
35 lines
827 B
2 months ago
|
<?php
|
||
|
|
||
|
namespace PhpOffice\PhpSpreadsheetTests\Helper;
|
||
|
|
||
|
use PhpOffice\PhpSpreadsheet\Helper\Html;
|
||
|
use PHPUnit\Framework\TestCase;
|
||
|
|
||
|
class HtmlTest extends TestCase
|
||
|
{
|
||
|
/**
|
||
|
* @dataProvider providerUtf8EncodingSupport
|
||
|
*
|
||
|
* @param mixed $expected
|
||
|
* @param mixed $input
|
||
|
*/
|
||
|
public function testUtf8EncodingSupport($expected, $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'],
|
||
|
];
|
||
|
}
|
||
|
}
|