PhpSpreadsheet/tests/PhpSpreadsheetTests/Helper/HtmlTest.php

34 lines
774 B
PHP
Raw Permalink Normal View History

<?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
*/
2020-05-18 04:49:57 +00:00
public function testUtf8EncodingSupport($expected, $input): void
{
$html = new Html();
$actual = $html->toRichTextObject($input);
self::assertSame($expected, $actual->getPlainText());
}
public function providerUtf8EncodingSupport()
{
return [
['foo', 'foo'],
['können', 'können'],
['русский', 'русский'],
["foo\nbar", '<p>foo</p><p>bar</p>'],
];
}
}