123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace Tests\Callback\Http\Controllers;
- use Modules\Callback\Http\Controllers\JuliangAccountController;
- use PHPUnit\Framework\TestCase;
- use Tests\UsedTestCase;
- class JuliangAccountControllerTest extends UsedTestCase
- {
- public function testAddAccount()
- {
- $res = $this->withHeaders([
- 'Authorization' => 'Bearer '. $this->token,
- ])->json('post','http://localhost/api/callback/juliangAccount/addAccount', [
- 'account_id' => 1234568,
- 'account_name' => 'jkljlkj',
- 'state' => 1,
- 'protect_num' => 3,
- 'default_rate' => 50,
- 'rate_time_config' => [
- ['start_time' => '00:35', 'end_time' => '12:34', 'config_per' => 20],
- ['start_time' => '13:39', 'end_time' => '19:34', 'config_per' => 30],
- ],
- 'min_money' => 20,
- 'max_money' => 50,
- ]);
- $res->dump();
- }
- public function testupdateCallbackConfig() {
- $res = $this->withHeaders([
- 'Authorization' => 'Bearer '. $this->token,
- ])->json('post','http://localhost/api/callback/juliangAccount/updateCallbackConfig', [
- 'ids' => [4],
- 'state' => 0,
- 'protect_num' => 3,
- 'default_rate' => 44,
- 'rate_time_config' => [
- ['start_time' => '15:00', 'end_time' => '15:10', 'config_per' => 40],
- ['start_time' => '15:20', 'end_time' => '15:30', 'config_per' => 56],
- ],
- 'min_money' => 40,
- 'max_money' => 60,
- ]);
- $res->dump();
- }
- public function testList() {
- $res = $this->withHeaders([
- 'Authorization' => 'Bearer '. $this->token,
- ])->json('get','http://localhost/api/callback/juliangAccount/list');
- $this->dumpJson($res);
- }
- }
|