Files
FOSSBilling/tests-legacy/library/Box/Box_TranslateTest.php
T
Belle Aerni 76321faf8e Misc fixes and cleanup (#2299)
* Misc fixes and cleanup

* More misc cleanup

* Removed outdated / invalid tests

* Update SentryHelper.php
2024-06-10 20:32:44 -07:00

37 lines
934 B
PHP

<?php
#[PHPUnit\Framework\Attributes\Group('Core')]
class Box_TranslateTest extends PHPUnit\Framework\TestCase
{
public function testsetLocale(): void
{
$locale = 'en_US';
$translateObj = new Box_Translate();
$translateObj->setLocale($locale);
$result = $translateObj->getLocale();
$this->assertEquals($locale, $result);
}
public function testDomainSetterAndGetter(): void
{
$translateObj = new Box_Translate();
$default = 'messages';
$result = $translateObj->getDomain();
$this->assertEquals($default, $result);
$newDomain = 'admin';
$result = $translateObj->setDomain($newDomain)->getDomain();
$this->assertEquals($newDomain, $result);
}
public function testTranslate(): void
{
$text = 'Translate ME';
$result = __trans($text);
$this->assertEquals($text, $result);
}
}