PhpSpreadsheet/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/RightTest.php

44 lines
1.2 KiB
PHP
Raw Normal View History

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\TextData;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\TextData;
use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
use PHPUnit\Framework\TestCase;
class RightTest extends TestCase
{
public function setUp()
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
StringHelper::setDecimalSeparator('.');
StringHelper::setThousandsSeparator(',');
StringHelper::setCurrencyCode('$');
}
public function tearDown()
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
StringHelper::setDecimalSeparator('.');
StringHelper::setThousandsSeparator(',');
StringHelper::setCurrencyCode('$');
}
/**
* @dataProvider providerRIGHT
*
* @param mixed $expectedResult
*/
public function testRIGHT($expectedResult, ...$args)
{
$result = TextData::RIGHT(...$args);
$this->assertEquals($expectedResult, $result);
}
public function providerRIGHT()
{
return require 'data/Calculation/TextData/RIGHT.php';
}
}