PhpSpreadsheet/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ConvertUoMTest.php

56 lines
1.4 KiB
PHP
Raw Normal View History

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Engineering;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PHPUnit\Framework\TestCase;
class ConvertUoMTest extends TestCase
{
2020-04-27 10:28:36 +00:00
protected function setUp(): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
}
2020-05-18 04:49:57 +00:00
public function testGetConversionGroups(): void
{
$result = Engineering::getConversionGroups();
2020-05-18 04:49:57 +00:00
self::assertIsArray($result);
}
2020-05-18 04:49:57 +00:00
public function testGetConversionGroupUnits(): void
{
$result = Engineering::getConversionGroupUnits();
2020-05-18 04:49:57 +00:00
self::assertIsArray($result);
}
2020-05-18 04:49:57 +00:00
public function testGetConversionGroupUnitDetails(): void
{
$result = Engineering::getConversionGroupUnitDetails();
2020-05-18 04:49:57 +00:00
self::assertIsArray($result);
}
2020-05-18 04:49:57 +00:00
public function testGetConversionMultipliers(): void
{
$result = Engineering::getConversionMultipliers();
2020-05-18 04:49:57 +00:00
self::assertIsArray($result);
}
/**
* @dataProvider providerCONVERTUOM
*
* @param mixed $expectedResult
*/
2020-05-18 04:49:57 +00:00
public function testCONVERTUOM($expectedResult, ...$args): void
{
$result = Engineering::CONVERTUOM(...$args);
2020-05-18 04:49:57 +00:00
self::assertEquals($expectedResult, $result);
}
public function providerCONVERTUOM()
{
return require 'tests/data/Calculation/Engineering/CONVERTUOM.php';
}
}