123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace think;
- // 加载基础文件
- define('BASE_ROOT_PATH',str_replace('/tests','',dirname(__FILE__)));
- define('BASE_PATH',BASE_ROOT_PATH . '/tests');
- define('APP_ID','tests');
- define('BASE_DATA_PATH',BASE_ROOT_PATH . '/data');
- require_once(BASE_ROOT_PATH . '/other/config.ini.php');
- require_once(BASE_ROOT_PATH . '/thinkphp/base.php');
- require_once(BASE_ROOT_PATH . '/extend/http.php');
- require_once(BASE_ROOT_PATH . '/extend/queue.logic.php');
- require_once(BASE_ROOT_PATH . '/extend/log.php');
- use PHPUnit\Framework\TestCase;
- use queue_logic;
- class TestIndex extends TestCase
- {
- protected $baseUrl = 'http://localhost';
- public static function setUpBeforeClass() : void
- {
- App::getInstance()->path(BASE_ROOT_PATH . '/application/')->initialize();
- }
- public function testCheckOrder()
- {
- $resp = http_request('http://host.docker.internal:8080/CheckOrder',['order_sn' => '123456'],'GET');
- }
- public function testInviteBonus()
- {
- $obj = new \app\index\controller\Index;
- $obj->_CheckOrder('123456789');
- }
- public function testOpenBox()
- {
- $logic_queue = new queue_logic();
- $logic_queue->OpenBox(['cabinet_code' => '0000000000000000','box_position_list' => [1],'delay_time' => 0,
- 'req_url' => 'http://221.217.229.194:8888','key' => '12345678','id' => '1234567' ,'ret_queue' => 'test_queue']);
- }
- public function testQueryBoxState()
- {
- $logic_queue = new queue_logic();
- $logic_queue->QueryBoxState(['cabinet_code' => '0000000000000000','box_position_list' => [1],'delay_time' => 0,
- 'req_url' => 'http://221.217.229.194:8888','key' => '12345678','id' => '1234567','ret_queue' => 'test_queue']);
- }
- public function testUpdateAllBoxState()
- {
- $logic_queue = new queue_logic();
- $logic_queue->UpdateAllBoxState();
- }
- }
|