public function testResolveItemDescriptions(string $value, array $macrofunc, string $expected): void {
<?php declare(strict_types = 0);
use PHPUnit\Framework\TestCase;
require_once __DIR__.'/../../../../../include/translateDefines.inc.php';
class CMacroFunctionTest extends TestCase {
protected $default_timezone;
protected function setUp(): void {
$this->default_timezone = date_default_timezone_get();
date_default_timezone_set('Europe/Riga');
protected function tearDown(): void {
date_default_timezone_set($this->default_timezone);
public function dataProviderRegsub(): array {
return json_decode(file_get_contents(__DIR__.'/CMacroFunctionRegsub.json'), true);
public function dataProviderFmtnum(): array {
return json_decode(file_get_contents(__DIR__.'/CMacroFunctionFmtnum.json'), true);
public function dataProviderFmttime(): array {
return json_decode(file_get_contents(__DIR__.'/CMacroFunctionFmttime.json'), true);
public function dataProviderRegrepl(): array {
return json_decode(file_get_contents(__DIR__.'/CMacroFunctionRegrepl.json'), true);
public function dataProviderTr(): array {
return json_decode(file_get_contents(__DIR__.'/CMacroFunctionTr.json'), true);
public function dataProviderBtoa(): array {
return json_decode(file_get_contents(__DIR__.'/CMacroFunctionBtoa.json'), true);
public function dataProviderUrlencode(): array {
return json_decode(file_get_contents(__DIR__.'/CMacroFunctionUrlencode.json'), true);
public function dataProviderHtmlencode(): array {
return json_decode(file_get_contents(__DIR__.'/CMacroFunctionHtmlencode.json'), true);