Passed
Push — master ( d7d67f...5441b2 )
by Adrien
27:59
created

CellTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 21
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testSetValueExplicit() 0 7 1
A providerSetValueExplicit() 0 3 1
1
<?php
2
3
namespace PhpOffice\PhpSpreadsheetTests\Cell;
4
5
use PhpOffice\PhpSpreadsheet\Spreadsheet;
6
use PHPUnit\Framework\TestCase;
7
8
class CellTest extends TestCase
9
{
10
    /**
11
     * @dataProvider providerSetValueExplicit
12
     *
13
     * @param mixed $expected
14
     * @param mixed $value
15
     * @param string $dataType
16
     */
17
    public function testSetValueExplicit($expected, $value, string $dataType)
18
    {
19
        $spreadsheet = new Spreadsheet();
20
        $cell = $spreadsheet->getActiveSheet()->getCell('A1');
21
        $cell->setValueExplicit($value, $dataType);
22
23
        self::assertSame($expected, $cell->getValue());
24
    }
25
26
    public function providerSetValueExplicit()
27
    {
28
        return require 'data/Cell/SetValueExplicit.php';
29
    }
30
}
31