mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-25 21:08:22 +00:00
3eedf9e2f0
Change "mixed" declarations to more accurate types in test members; in particular, change those that would be flagged if we were to run Phpstan at level 9 (we currently run level 8). I may or may not follow up with source code (over 700 level-9 problems remain for src), but, as with strict typing, there is no reason to avoid the effort for test members. It was necessary to update some doc blocks in src to accommodate this change. However, no executable code is touched.
37 lines
948 B
PHP
37 lines
948 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Logical;
|
|
|
|
class OrTest extends AllSetupTeardown
|
|
{
|
|
/**
|
|
* @dataProvider providerOR
|
|
*/
|
|
public function testOR(mixed $expectedResult, mixed ...$args): void
|
|
{
|
|
$this->runTestCase('OR', $expectedResult, ...$args);
|
|
}
|
|
|
|
public static function providerOR(): array
|
|
{
|
|
return require 'tests/data/Calculation/Logical/OR.php';
|
|
}
|
|
|
|
/**
|
|
* @dataProvider providerORLiteral
|
|
*/
|
|
public function testORLiteral(bool|string $expectedResult, float|int|string $formula): void
|
|
{
|
|
$sheet = $this->getSheet();
|
|
$sheet->getCell('A1')->setValue("=OR($formula)");
|
|
self::assertSame($expectedResult, $sheet->getCell('A1')->getCalculatedValue());
|
|
}
|
|
|
|
public static function providerORLiteral(): array
|
|
{
|
|
return require 'tests/data/Calculation/Logical/ORLiteral.php';
|
|
}
|
|
}
|