Failed Conditions
Push — master ( 36acc3...2eb342 )
by Adrien
36:49
created

HtmlTest::testUtf8EncodingSupport()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace PhpOffice\PhpSpreadsheetTests\Helper;
4
5
use PhpOffice\PhpSpreadsheet\Helper\Html;
6
use PHPUnit\Framework\TestCase;
7
8
class HtmlTest extends TestCase
9
{
10
    /**
11
     * @dataProvider providerUtf8EncodingSupport
12
     *
13
     * @param mixed $expected
14
     * @param mixed $input
15
     */
16
    public function testUtf8EncodingSupport($expected, $input)
17
    {
18
        $html = new Html();
19
        $actual = $html->toRichTextObject($input);
20
21
        self::assertSame($expected, $actual->getPlainText());
22
    }
23
24
    public function providerUtf8EncodingSupport()
25
    {
26
        return [
27
            ['foo', 'foo'],
28
            ['können', 'können'],
29
            ['русский', 'русский'],
30
            ["foo\nbar", '<p>foo</p><p>bar</p>'],
31
        ];
32
    }
33
}
34