ConfigTest.php 699 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. class ConfigTest extends \PHPUnit\Framework\TestCase {
  3. public function setUp() : void {
  4. $c = Config::getInstance();
  5. $all = $c->getAll();
  6. $all['xmlrpc_enabled'] = false;
  7. $c->setAll($all);
  8. parent::setUp();
  9. }
  10. public function testLangF() {
  11. $x = Config::lang_f('must_be_numeric', 'foo@bar');
  12. $this->assertEquals('foo@bar must be numeric', $x);
  13. }
  14. public function testLang() {
  15. $x = Config::lang('must_be_numeric', 'foo@bar');
  16. $this->assertEquals('%s must be numeric', $x);
  17. }
  18. public function testBool() {
  19. $x = Config::bool('xmlrpc_enabled');
  20. $this->assertFalse($x);
  21. }
  22. }