0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00
postfixadmin/tests/ConfigTest.php

39 lines
714 B
PHP
Raw Permalink Normal View History

2020-05-02 20:08:47 +02:00
<?php
2021-03-22 10:28:28 +01:00
class ConfigTest extends \PHPUnit\Framework\TestCase
{
2022-06-28 14:46:11 +02:00
public function setUp(): void
2021-04-13 22:19:16 +02:00
{
2020-05-02 20:08:47 +02:00
$c = Config::getInstance();
$all = $c->getAll();
$all['xmlrpc_enabled'] = false;
$c->setAll($all);
parent::setUp();
}
2021-04-13 22:19:16 +02:00
public function testLangF()
{
2020-05-02 20:08:47 +02:00
$x = Config::lang_f('must_be_numeric', 'foo@bar');
$this->assertEquals('foo@bar must be numeric', $x);
}
2021-04-13 22:19:16 +02:00
public function testLang()
{
2020-05-02 20:08:47 +02:00
$x = Config::lang('must_be_numeric', 'foo@bar');
$this->assertEquals('%s must be numeric', $x);
}
2021-04-13 22:19:16 +02:00
public function testBool()
{
2020-05-02 20:08:47 +02:00
$x = Config::bool('xmlrpc_enabled');
$this->assertFalse($x);
}
}