public function testReset() { Config::set('chimpanzee', 'CTO'); $this->assertEquals('CTO', Config::get('chimpanzee')); Config::reset(); $this->assertNull(Config::get('chimpanzee')); }
public function testParse() { Config::parse('inistring=1', 'ini'); $this->assertEquals(1, Config::get('inistring')); Config::reset(); Config::parse('tests/framework/application/test.ini'); $this->assertTrue(Config::has('inifile')); $this->assertEquals(1, Config::get('inifile')); Config::reset(); }
public function testParse() { Config::parse('<?xml version="1.0"?><document><xmlstring>1</xmlstring></document>', 'xml'); $this->assertEquals(1, Config::get('xmlstring')); Config::reset(); Config::parse('tests/framework/application/test.xml'); $this->assertTrue(Config::has('xmlfile.istrue')); $this->assertEquals(1, Config::get('xmlfile.istrue')); Config::reset(); }
public function testParse() { Config::parse('<?xml version="1.0"?><document><xmlstring>1</xmlstring></document>', 'xml'); $this->assertEquals(1, Config::get('xmlstring')); Config::reset(); Config::parse(__DIR__ . '/fixtures/config.xml'); $this->assertTrue(Config::has('xmlfile.istrue')); $this->assertEquals(1, Config::get('xmlfile.istrue')); Config::reset(); }
public function testParse() { Config::parse('inistring=1', 'ini'); $this->assertEquals(1, Config::get('inistring')); Config::reset(); Config::parse(__DIR__ . '/fixtures/config.ini'); $this->assertTrue(Config::has('inifile')); $this->assertEquals(1, Config::get('inifile')); Config::reset(); }
public function testParse() { Config::parse('{"jsonstring":1}', 'json'); $this->assertEquals(1, Config::get('jsonstring')); Config::reset(); Config::parse(__DIR__ . '/fixtures/config.json'); $this->assertTrue(Config::has('jsonstring')); $this->assertEquals(1, Config::get('jsonstring')); Config::reset(); }
/** * 测试操作缓存 */ public function testApc() { App::run(Config::get()); $this->assertInstanceOf('\\think\\cache\\driver\\Apc', Cache::connect(['type' => 'apc', 'expire' => 1])); $this->assertTrue(Cache::set('key', 'value')); $this->assertEquals('value', Cache::get('key')); $this->assertTrue(Cache::rm('key')); $this->assertFalse(Cache::get('key')); $this->assertTrue(Cache::clear('key')); Config::reset(); }
?> </b><br/> <a href="?reset=1&confirm=1"><?php echo _('Yes'); ?> </a> | <a href="main.php"><?php echo _('No'); ?> </a> </p> <?php exit; } $config = new Config(); $config->reset(); header('Location: ' . $_SERVER['SCRIPT_NAME'] . '?word=' . $word . '§ion=' . $section); exit; } $default_open = REQUEST('open'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title> <?php echo _('Advanced Configuration'); ?> </title> <meta http-equiv="Pragma" content="no-cache"/> <?php
public function testIndex() { $this->assertContains('ThinkPHP5', App::run(Config::get())); Config::reset(); }