Failed Conditions
Push — develop ( 11b055...32a55a )
by Adrien
30:13
created

Enclosure::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
nc 1
nop 1
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace PhpOffice\PhpSpreadsheetTests\Functional;
4
5
use PhpOffice\PhpSpreadsheet\Spreadsheet;
6
7
class Enclosure extends AbstractFunctional
8
{
9 View Code Duplication
    public function providerFormats()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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