@@ -274,16 +274,19 @@ public function testSpotMarketBuyTest()
274
274
public function testSpotMarketQuoteSell ()
275
275
{
276
276
try {
277
- $ this ->binance ->marketQuoteSell ($ this ->symbol , 1 );
277
+ $ this ->binance ->marketQuoteSell ($ this ->symbol , ' 1 ' );
278
278
279
279
} catch (\Throwable $ e ) {
280
280
281
281
}
282
+ // warns here cuz method needs information fetched by exchangeInfo
282
283
$ this ->assertEquals ("https://api.binance.com/api/v3/order " , self ::$ capturedUrl );
283
284
284
285
parse_str (self ::$ capturedBody , $ params );
285
286
286
287
$ this ->assertEquals ($ this ->symbol , $ params ['symbol ' ]);
288
+ $ this ->assertEquals ('SELL ' , $ params ['side ' ]);
289
+ $ this ->assertEquals ('MARKET ' , $ params ['type ' ]);
287
290
$ this ->assertEquals (1 , $ params ['quoteOrderQty ' ]);
288
291
$ this ->assertTrue (str_starts_with ($ params ['newClientOrderId ' ], $ this ->SPOT_ORDER_PREFIX ));
289
292
}
@@ -313,12 +316,15 @@ public function testSpotMarketSell()
313
316
} catch (\Throwable $ e ) {
314
317
315
318
}
319
+ // warns here cuz method needs information fetched by exchangeInfo
316
320
$ this ->assertEquals ("https://api.binance.com/api/v3/order " , self ::$ capturedUrl );
317
321
318
322
parse_str (self ::$ capturedBody , $ params );
319
323
320
324
$ this ->assertEquals ($ this ->symbol , $ params ['symbol ' ]);
321
325
$ this ->assertEquals (1 , $ params ['quantity ' ]);
326
+ $ this ->assertEquals ('SELL ' , $ params ['side ' ]);
327
+ $ this ->assertEquals ('MARKET ' , $ params ['type ' ]);
322
328
$ this ->assertTrue (str_starts_with ($ params ['newClientOrderId ' ], $ this ->SPOT_ORDER_PREFIX ));
323
329
}
324
330
@@ -507,9 +513,15 @@ public function testSpotExchangeInfo()
507
513
} catch (\Throwable $ e ) {
508
514
509
515
}
510
- $ query ='symbols=[" ' . implode ('"," ' , $ this ->symbols ) . '"] ' ;
511
- $ endpoint = "https://api.binance.com/api/v3/exchangeInfo? " . $ query ;
512
- $ this ->assertEquals (self ::$ capturedUrl , $ endpoint );
516
+ $ endpoint = "https://api.binance.com/api/v3/exchangeInfo? " ;
517
+ $ this ->assertTrue (str_starts_with (self ::$ capturedUrl , $ endpoint ));
518
+
519
+ $ queryString = substr (self ::$ capturedUrl , strlen ($ endpoint ));
520
+ parse_str ($ queryString , $ params );
521
+ $ this ->assertTrue (!empty ($ params ['symbols ' ]));
522
+ $ symbols = $ params ['symbols ' ];
523
+ $ this ->assertTrue (str_contains ($ symbols , $ this ->symbols [0 ]));
524
+ $ this ->assertTrue (str_contains ($ symbols , $ this ->symbols [1 ]));
513
525
}
514
526
515
527
public function testAssetDetail ()
@@ -623,7 +635,6 @@ public function testDepositAddress()
623
635
624
636
$ this ->assertEquals ($ this ->asset , $ params ['coin ' ]);
625
637
$ this ->assertEquals ($ this ->network , $ params ['network ' ]);
626
-
627
638
}
628
639
629
640
public function testDepositHistory ()
@@ -641,7 +652,6 @@ public function testDepositHistory()
641
652
parse_str ($ queryString , $ params );
642
653
643
654
$ this ->assertEquals ($ this ->asset , $ params ['coin ' ]);
644
-
645
655
}
646
656
647
657
public function testWithdrawHistory ()
@@ -745,7 +755,6 @@ public function testSpotPrice()
745
755
parse_str ($ queryString , $ params );
746
756
747
757
$ this ->assertEquals ($ this ->symbol , $ params ['symbol ' ]);
748
-
749
758
}
750
759
751
760
public function testSpotBookPrices ()
@@ -861,7 +870,6 @@ public function testSpotDepth()
861
870
862
871
$ this ->assertEquals ($ this ->symbol , $ params ['symbol ' ]);
863
872
$ this ->assertEquals ($ this ->limit , $ params ['limit ' ]);
864
-
865
873
}
866
874
867
875
public function testSpotBalances ()
@@ -1046,7 +1054,7 @@ public function testApiTradingStatus()
1046
1054
public function testOcoOrder ()
1047
1055
{
1048
1056
try {
1049
- $ this ->binance ->ocoOrder ($ this ->side , $ this ->symbol , $ this ->quantity , $ this ->price , $ this ->stopprice , $ this ->stoplimitprice , $ this -> stoplimittimeinforce );
1057
+ $ this ->binance ->ocoOrder ($ this ->side , $ this ->symbol , $ this ->quantity , $ this ->price , $ this ->stopprice , $ this ->stoplimitprice );
1050
1058
1051
1059
} catch (\Throwable $ e ) {
1052
1060
@@ -1062,7 +1070,6 @@ public function testOcoOrder()
1062
1070
$ this ->assertEquals ($ this ->stopprice , $ params ['stopPrice ' ]);
1063
1071
$ this ->assertEquals ($ this ->stoplimitprice , $ params ['stopLimitPrice ' ]);
1064
1072
$ this ->assertEquals ('GTC ' , $ params ['stopLimitTimeInForce ' ]);
1065
- $ this ->assertTrue (str_starts_with ($ params ['newClientOrderId ' ], $ this ->SPOT_ORDER_PREFIX_ORDER_PREFIX ));
1066
1073
}
1067
1074
1068
1075
public function testSpotAvgPrice ()
@@ -1080,7 +1087,6 @@ public function testSpotAvgPrice()
1080
1087
parse_str ($ queryString , $ params );
1081
1088
1082
1089
$ this ->assertEquals ($ this ->symbol , $ params ['symbol ' ]);
1083
-
1084
1090
}
1085
1091
1086
1092
public function testBswapQuote ()
@@ -1141,7 +1147,6 @@ public function testFuturesDepth()
1141
1147
1142
1148
$ this ->assertEquals ($ this ->symbol , $ params ['symbol ' ]);
1143
1149
$ this ->assertEquals ($ this ->limit , $ params ['limit ' ]);
1144
-
1145
1150
}
1146
1151
1147
1152
public function testFuturesRecentTrades ()
@@ -1313,7 +1318,6 @@ public function testFuturesPremiumIndexCandlesticks()
1313
1318
$ this ->assertEquals ($ this ->limit , $ params ['limit ' ]);
1314
1319
$ this ->assertEquals ($ this ->startTime , $ params ['startTime ' ]);
1315
1320
$ this ->assertEquals ($ this ->endTime , $ params ['endTime ' ]);
1316
-
1317
1321
}
1318
1322
1319
1323
public function testFuturesMarkPrice ()
@@ -1428,7 +1432,6 @@ public function testFuturesPriceV2()
1428
1432
parse_str ($ queryString , $ params );
1429
1433
1430
1434
$ this ->assertEquals ($ this ->symbol , $ params ['symbol ' ]);
1431
-
1432
1435
}
1433
1436
1434
1437
public function testFuturesSymbolOrderBookTicker ()
@@ -1837,8 +1840,8 @@ public function testFuturesEditOrder()
1837
1840
$ this ->assertEquals ($ this ->side , $ params ['side ' ]);
1838
1841
$ this ->assertEquals ($ this ->quantity , $ params ['quantity ' ]);
1839
1842
$ this ->assertEquals ($ this ->price , $ params ['price ' ]);
1840
- $ this ->assertEquals ($ this ->paramsId , $ params ['paramsId ' ]);
1841
- $ this ->assertEquals (" GTC " , $ params ['timeInForce ' ]);
1843
+ $ this ->assertEquals ($ this ->orderId , $ params ['orderId ' ]);
1844
+ $ this ->assertEquals (' GTC ' , $ params ['timeInForce ' ]);
1842
1845
}
1843
1846
1844
1847
public function testFuturesEditOrders ()
@@ -1855,7 +1858,7 @@ public function testFuturesEditOrders()
1855
1858
$ this ->binance ->futuresEditOrders ([ $ order ], $ this ->recvWindow );
1856
1859
1857
1860
} catch (\Throwable $ e ) {
1858
- print_r ( $ e );
1861
+
1859
1862
}
1860
1863
$ endpoint = "https://fapi.binance.com/fapi/v1/batchOrders? " ;
1861
1864
$ this ->assertTrue (str_starts_with (self ::$ capturedUrl , $ endpoint ));
@@ -1923,7 +1926,7 @@ public function testFuturesCancelBatchOrdersByOrderIds()
1923
1926
} catch (\Throwable $ e ) {
1924
1927
1925
1928
}
1926
- $ endpoint = "https://fapi.binance.com/fapi/v1/batchOrders? " . $ query ;
1929
+ $ endpoint = "https://fapi.binance.com/fapi/v1/batchOrders? " ;
1927
1930
$ this ->assertTrue (str_starts_with (self ::$ capturedUrl , $ endpoint ));
1928
1931
1929
1932
$ queryString = substr (self ::$ capturedUrl , strlen ($ endpoint ));
@@ -1942,7 +1945,7 @@ public function testFuturesCancelBatchOrdersByClientOrderIds()
1942
1945
} catch (\Throwable $ e ) {
1943
1946
1944
1947
}
1945
- $ endpoint = "https://fapi.binance.com/fapi/v1/batchOrders? " . $ query ;
1948
+ $ endpoint = "https://fapi.binance.com/fapi/v1/batchOrders? " ;
1946
1949
$ this ->assertTrue (str_starts_with (self ::$ capturedUrl , $ endpoint ));
1947
1950
1948
1951
$ queryString = substr (self ::$ capturedUrl , strlen ($ endpoint ));
@@ -2205,12 +2208,11 @@ public function testFuturesPositionMode()
2205
2208
} catch (\Throwable $ e ) {
2206
2209
2207
2210
}
2208
- $ endpoint = "https://fapi.binance.com/fapi/v1/positionSide/dual? " . $ query ;
2211
+ $ endpoint = "https://fapi.binance.com/fapi/v1/positionSide/dual? " ;
2209
2212
$ this ->assertTrue (str_starts_with (self ::$ capturedUrl , $ endpoint ));
2210
2213
2211
2214
$ queryString = substr (self ::$ capturedUrl , strlen ($ endpoint ));
2212
2215
parse_str ($ queryString , $ params );
2213
-
2214
2216
$ this ->assertEquals ($ this ->recvWindow , $ params ['recvWindow ' ]);
2215
2217
}
2216
2218
@@ -2822,7 +2824,7 @@ public function testConvertSend()
2822
2824
$ this ->binance ->convertSend ($ this ->fromAsset , $ this ->toAsset , $ this ->fromAmount , null , $ this ->validTime , $ this ->recvWindow );
2823
2825
2824
2826
} catch (\Throwable $ e ) {
2825
- print_r ( $ e );
2827
+
2826
2828
}
2827
2829
$ this ->assertEquals ("https://fapi.binance.com/fapi/v1/convert/getQuote " , self ::$ capturedUrl );
2828
2830
@@ -2849,7 +2851,6 @@ public function testConvertAccept()
2849
2851
2850
2852
$ this ->assertEquals ($ this ->quoteId , $ params ['quoteId ' ]);
2851
2853
$ this ->assertEquals ($ this ->recvWindow , $ params ['recvWindow ' ]);
2852
- $ this ->assertEquals ($ this ->params , $ params ['params ' ]);
2853
2854
}
2854
2855
2855
2856
public function testConvertStatusByOrderId ()
0 commit comments