Failed Conditions
Push — master ( 27d83b...a2771e )
by Adrien
35:04
created

EnclosureTest::testEnclosure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 11
rs 9.4285
1
<?php
2
3
namespace PhpOffice\PhpSpreadsheetTests\Functional;
4
5
use PhpOffice\PhpSpreadsheet\Spreadsheet;
6
7
class EnclosureTest extends AbstractFunctional
8
{
9
    public function providerFormats()
10
    {
11
        return [
12
            ['Html'],
13
            ['Xls'],
14
            ['Xlsx'],
15
            ['Ods'],
16
            ['Csv'],
17
        ];
18
    }
19
20
    /**
21
     * @dataProvider providerFormats
22
     *
23
     * @param string $format
24
     */
25
    public function testEnclosure($format)
26
    {
27
        $value = '<img alt="" src="http://example.com/image.jpg" />';
28
29
        $spreadsheet = new Spreadsheet();
30
        $spreadsheet->getActiveSheet()->getCell('A1')->setValue($value);
31
32
        $reloadedSpreadsheet = $this->writeAndReload($spreadsheet, $format);
33
34
        $actual = $reloadedSpreadsheet->getActiveSheet()->getCell('A1')->getCalculatedValue();
35
        self::assertSame($value, $actual, 'should be able to write and read strings with multiples quotes');
36
    }
37
}
38