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