Failed Conditions
Push — master ( 02f37d...f95322 )
by Adrien
09:26
created

ImSechTest::tearDown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Engineering;
4
5
use PhpOffice\PhpSpreadsheet\Calculation\Engineering;
6
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
7
use PhpOffice\PhpSpreadsheetTests\Custom\ComplexAssert;
8
use PHPUnit\Framework\TestCase;
9
10
class ImSechTest extends TestCase
11
{
12
    const COMPLEX_PRECISION = 1E-8;
13
14
    /**
15
     * @var ComplexAssert
16
     */
17
    protected $complexAssert;
18
19
    protected function setUp(): void
20
    {
21
        Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
22
        $this->complexAssert = new ComplexAssert();
23
    }
24
25
    /**
26
     * @dataProvider providerIMSECH
27
     *
28
     * @param mixed $expectedResult
29
     * @param mixed $value
30
     */
31
    public function testIMSECH($expectedResult, $value): void
32
    {
33
        $result = Engineering::IMSECH($value);
34
        self::assertTrue(
35
            $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
36
            $this->complexAssert->getErrorMessage()
37
        );
38
    }
39
40
    public function providerIMSECH()
41
    {
42
        return require 'tests/data/Calculation/Engineering/IMSECH.php';
43
    }
44
}
45