mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-10-10 13:56:46 +00:00
1b05dfab8b
And quite a bit more manual changes. The idea is that typing of our tests can be a bit more loose, so we assume PHPDoc is mostly correct. If that happens to be wrong, it should be caught by the tests themselves.
35 lines
905 B
PHP
35 lines
905 B
PHP
<?php
|
|
|
|
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(mixed $expectedResult, mixed $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';
|
|
}
|
|
}
|