Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andanyoung committed Dec 3, 2019
1 parent 5def984 commit 167a293
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
13 changes: 12 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
}
],
"require": {
"php": ">=5.3"
"php": ">=7.0.0",
"topthink/framework": "5.1.*"
},
"autoload": {
"psr-4": {
"tests\\": "tests",
"think\\": "thinkphp/library/think",
"traits\\": "thinkphp/library/traits"
}
},
"require-dev": {
"phpunit/phpunit": "8"
}
}
24 changes: 12 additions & 12 deletions src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
// +----------------------------------------------------------------------
namespace tests;

//use think\App;
use think\App;


abstract class TestCase
abstract class TestCase extends \PHPUnit\Framework\TestCase
{
protected $baseUrl = '';
// use ApplicationTrait, AssertionsTrait, CrawlerTrait;
use ApplicationTrait, AssertionsTrait, CrawlerTrait;

// public function __construct(string $name = null, array $data = [], string $dataName = '')
// {
// // 引入需要的环境
// require_once __DIR__ . '/../thinkphp/base.php';
// // 初始化 App 对象,并将 APP_PATH 指向项目的 application 目录
// App::getInstance()->path(__DIR__ . '/../application/')->initialize();
//
// parent::__construct($name, $data, $dataName);
// }
public function __construct(string $name = null, array $data = [], string $dataName = '')
{
// 引入需要的环境
require_once __DIR__ . '/../thinkphp/base.php';
// 初始化 App 对象,并将 APP_PATH 指向项目的 application 目录
App::getInstance()->path(__DIR__ . '/../application/')->initialize();

parent::__construct($name, $data, $dataName);
}
}

0 comments on commit 167a293

Please sign in to comment.