TestIndex.php 625 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace think;
  3. // 加载基础文件
  4. define('BASE_ROOT_PATH',str_replace('/tests','',dirname(__FILE__)));
  5. define('BASE_PATH',BASE_ROOT_PATH . '/tests');
  6. define('APP_ID','tests');
  7. require BASE_ROOT_PATH . '/thinkphp/base.php';
  8. use PHPUnit\Framework\TestCase;
  9. class TestIndex extends TestCase
  10. {
  11. protected $baseUrl = 'http://localhost';
  12. public static function setUpBeforeClass() : void
  13. {
  14. App::getInstance()->path(BASE_ROOT_PATH . '/application/')->initialize();
  15. }
  16. public function testInviteBonus()
  17. {
  18. $obj = new \app\index\controller\Index;
  19. $obj->index();
  20. }
  21. }