mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-02 05:08:06 +09:00
* Misc fixes and cleanup * More misc cleanup * Removed outdated / invalid tests * Update SentryHelper.php
37 lines
934 B
PHP
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);
|
|
}
|
|
}
|