Passed
Pull Request — master (#4276)
by Owen
13:56
created

XorTest::testXORLiteral()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Logical;
6
7
class XorTest extends AllSetupTeardown
8
{
9
    #[\PHPUnit\Framework\Attributes\DataProvider('providerXOR')]
10
    public function testXOR(mixed $expectedResult, mixed ...$args): void
11
    {
12
        $this->runTestCase('XOR', $expectedResult, ...$args);
13
    }
14
15
    public static function providerXOR(): array
16
    {
17
        return require 'tests/data/Calculation/Logical/XOR.php';
18
    }
19
20
    #[\PHPUnit\Framework\Attributes\DataProvider('providerXORLiteral')]
21
    public function testXORLiteral(mixed $expectedResult, float|string $formula): void
22
    {
23
        $sheet = $this->getSheet();
24
        $sheet->getCell('A1')->setValue("=XOR($formula)");
25
        self::assertSame($expectedResult, $sheet->getCell('A1')->getCalculatedValue());
26
    }
27
28
    public static function providerXORLiteral(): array
29
    {
30
        return require 'tests/data/Calculation/Logical/XORLiteral.php';
31
    }
32
}
33