TestCase.php 1.1 KB

12345678910111213141516171819202122232425
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006-2015 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: yunwuxin <448901948@qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace tests;
  12. class TestCase extends \think\testing\TestCase
  13. {
  14. protected $baseUrl = 'http://localhost';
  15. public function __construct(?string $name = null, array $data = [], string $dataName = '') {
  16. // 引入需要的环境
  17. require_once __DIR__ . '/../thinkphp/base.php';
  18. // 初始化 App 对象,并将 APP_PATH 指向项目的 application 目录
  19. App::getInstance()->path(__DIR__ . '/../application/')->initialize();
  20. parent::__construct($name, $data, $dataName);
  21. }
  22. }