提交 a0779c54 编写于 作者: Y yuenblue

config env

上级 5ae61d64
APP_DEBUG = true [APP] DEFAULT_TIMEZONE = Asia/Shanghai [DATABASE] TYPE = mysql HOSTNAME = 127.0.0.1 DATABASE = test USERNAME = username PASSWORD = password HOSTPORT = 3306 CHARSET = utf8 DEBUG = true [LANG] default_lang = zh-cn
\ No newline at end of file
<?php
namespace think;
use PHPUnit\Framework\TestCase;
use think\facade\Config;
use function PHPUnit\Framework\assertTrue;
class DemoTp6 extends TestCase{
public static function setUpBeforeClass(): void
{
$http = (new App())->setEnvName('example')->http;
$response = $http->run();
}
function testAa() {
// assertTrue(function_exists('env'));
$app = app();
assertTrue(true);
$aa=Config::get("app.with_route");
var_dump($aa);
$bb=env('database.type');
$cc=env("database.HOSTPORT");
var_dump($bb,$cc);
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册