Conditions | 2 |
Paths | 2 |
Total Lines | 24 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | public function testSuccessEndpoint() |
||
13 | { |
||
14 | $bybit = (new BybitAPI())->setCredentials('https://api-testnet.bybit.com', 'fL02oi5qo8i2jDxlum', 'Ne1EE35XTprIWrId9vGEAc1ZYJTmodA4qFzZ'); |
||
15 | |||
16 | $isSwitchCrossMargin = $bybit->privateEndpoint( |
||
17 | SwitchPositionMode::class, |
||
18 | (new SwitchPositionModeRequest()) |
||
19 | ->setSymbol('BTCUSDT') |
||
20 | ->setMode(3) |
||
21 | )->execute(); |
||
22 | |||
23 | if ($isSwitchCrossMargin->getReturnCode() == 0) { |
||
24 | echo "Success set position mode: {$isSwitchCrossMargin->getReturnMessage()}\n"; |
||
25 | } else { |
||
26 | echo "Failed set position mode: {$isSwitchCrossMargin->getReturnMessage()}\n"; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Success set position mode: OK |
||
31 | * ----- OR |
||
32 | * Failed set position mode: symbol has order, can not switch mode |
||
33 | */ |
||
34 | |||
35 | $this->assertTrue(true); |
||
36 | } |
||
38 |