提交 47def4a5 编写于 作者: Y yuenblue

aaa

上级 38fc3965
<?php
namespace app\controller;
use think\Request;
class Demo{
function Say() {
print("你好,我是Demo");
function phpinfo() {
phpinfo();
}
function say(Request $request) {
return "hello world!{$request->domain()}";
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@
namespace app\controller;
use app\BaseController;
use think\facade\Route;
class Index extends BaseController
{
......@@ -12,7 +13,7 @@ class Index extends BaseController
public function hello($name = 'ThinkPHP6')
{
phpinfo();
var_dump($this->request);
return Route::buildUrl('aaaa',['name'=>$name])->__toString();
}
}
......@@ -7,17 +7,17 @@ return [
// pathinfo分隔符
'pathinfo_depr' => '/',
// URL伪静态后缀
'url_html_suffix' => 'html',
'url_html_suffix' => '',
// URL普通方式参数 用于自动生成
'url_common_param' => true,
// 是否开启路由延迟解析
'url_lazy_route' => false,
// 是否强制使用路由
'url_route_must' => false,
'url_route_must' => true,
// 合并路由规则
'route_rule_merge' => false,
// 路由是否完全匹配
'route_complete_match' => false,
'route_complete_match' => true,
// 访问控制器层名称
'controller_layer' => 'controller',
// 空控制器名
......
......@@ -10,8 +10,13 @@
// +----------------------------------------------------------------------
use think\facade\Route;
Route::group("demo",function(){
Route::get('say','demo/say');
Route::get('i','demo/phpinfo');
});
Route::get('think', function () {
return 'hello,ThinkPHP6!';
});
Route::get('hello/:name', 'index/hello');
Route::get('hello/:name', 'index/hello')->name("aaaa");
......@@ -3,13 +3,23 @@ use PHPUnit\Framework\TestCase;
use function PHPUnit\Framework\assertEmpty;
use function PHPUnit\Framework\assertNull;
use function PHPUnit\Framework\assertTrue;
use app\controller\Demo;
class DemoTest extends TestCase
{
public function testAaa(){
$dd=new Demo();
$dd->Say();
assertEmpty("");
// $dd=new Demo();
// $dd->Say();
// assertEmpty("");
}
function tearDown(): void
{
assertTrue(true);
}
public function testLog(){
echo "aaaa";
echo "bbbb";
}
}
......@@ -3,6 +3,7 @@ namespace think;
use app\model\User;
use PHPUnit\Framework\TestCase;
use think\facade\Cache;
use think\facade\Config;
use think\facade\Db;
......@@ -52,4 +53,7 @@ class DemoTp6 extends TestCase{
// assertTrue($aa);
$this->assertNotEmpty($user);
}
function testCache() {
Cache::get("")
}
}
\ No newline at end of file
<?php
echo "aaaa\r\n";
echo "aaaa\r\n";
echo "aaaa\r\n";
print "aaaa\r\n";
print "aaaa\r\n";
print "bbbb";
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册