// +---------------------------------------------------------------------- /** * Xml配置测试 * @author 7IN0SAN9 */ namespace tests\thinkphp\library\think\config\driver; use think\config; class jsonTest extends \PHPUnit_Framework_TestCase { 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(); } }