TestIndex.php 584 B

1234567891011121314151617181920212223242526272829
  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. public static function setUpBeforeClass() : void
  12. {
  13. App::getInstance()->path(BASE_ROOT_PATH . '/application/')->initialize();
  14. }
  15. public function testInviteBonus()
  16. {
  17. $obj = new \app\index\controller\Index;
  18. $obj->index();
  19. }
  20. }