PhpSpreadsheet/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinTest.php

27 lines
734 B
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;
class AsinTest extends AllSetupTeardown
{
/**
* @dataProvider providerAsin
*
* @param mixed $expectedResult
*/
public function testAsin($expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
$sheet = $this->sheet;
$sheet->getCell('A2')->setValue(0.5);
$sheet->getCell('A1')->setValue("=ASIN($formula)");
$result = $sheet->getCell('A1')->getCalculatedValue();
self::assertEqualsWithDelta($expectedResult, $result, 1E-6);
}
public function providerAsin()
{
return require 'tests/data/Calculation/MathTrig/ASIN.php';
}
}