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

HtmlTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testUtf8EncodingSupport() 0 6 1
A providerUtf8EncodingSupport() 0 7 1
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