Example #1
0
 public function testReset()
 {
     Config::set('chimpanzee', 'CTO');
     $this->assertEquals('CTO', Config::get('chimpanzee'));
     Config::reset();
     $this->assertNull(Config::get('chimpanzee'));
 }
Example #2
0
 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();
 }
Example #3
0
 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();
 }
Example #4
0
 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();
 }
Example #5
0
 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();
 }
Example #6
0
 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();
 }
Example #7
0
 /**
  * 测试操作缓存
  */
 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();
 }
Example #8
0
        ?>
</b><br/>
            <a href="?reset=1&confirm=1"><?php 
        echo _('Yes');
        ?>
</a>&nbsp;|&nbsp;
            <a href="main.php"><?php 
        echo _('No');
        ?>
</a>
        </p>
        <?php 
        exit;
    }
    $config = new Config();
    $config->reset();
    header('Location: ' . $_SERVER['SCRIPT_NAME'] . '?word=' . $word . '&section=' . $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 
Example #9
0
 public function testIndex()
 {
     $this->assertContains('ThinkPHP5', App::run(Config::get()));
     Config::reset();
 }