123456789101112131415161718192021222324252627282930 |
- <?php
- namespace think;
- // 加载基础文件
- define('BASE_ROOT_PATH',str_replace('/tests','',dirname(__FILE__)));
- define('BASE_PATH',BASE_ROOT_PATH . '/tests');
- define('APP_ID','tests');
- require BASE_ROOT_PATH . '/thinkphp/base.php';
- use PHPUnit\Framework\TestCase;
- class TestIndex extends TestCase
- {
- protected $baseUrl = 'http://localhost';
- public static function setUpBeforeClass() : void
- {
- App::getInstance()->path(BASE_ROOT_PATH . '/application/')->initialize();
- }
- public function testInviteBonus()
- {
- $obj = new \app\index\controller\Index;
- $obj->index();
- }
- }
|