@@ -714,18 +714,19 @@ public function testSymbolOrderBookTickerFutures()
714
714
$ this ->assertIsInt ($ res ['time ' ]);
715
715
}
716
716
717
- public function testDeliveryPriceFutures ()
718
- {
719
- $ this ->futuresBinance ->useTestnet = false ; // set to false for fapiData request
720
- $ res = $ this ->futuresBinance ->futuresDeliveryPrice ($ this ->symbol );
721
- $ this ->assertIsArray ($ res );
722
- $ this ->assertIsArray ($ res [0 ]);
723
- $ this ->assertArrayHasKey ('deliveryTime ' , $ res [0 ]);
724
- $ this ->assertIsInt ($ res [0 ]['deliveryTime ' ]);
725
- $ this ->assertArrayHasKey ('deliveryPrice ' , $ res [0 ]);
726
- $ this ->assertIsNumeric ($ res [0 ]['deliveryPrice ' ]);
727
- $ this ->futuresBinance ->useTestnet = true ; // reset to true for other tests
728
- }
717
+
718
+ // public function testDeliveryPriceFutures() // Could throw an error if useTestnet is set to false
719
+ // {
720
+ // $this->futuresBinance->useTestnet = false; // set to false for fapiData request
721
+ // $res = $this->futuresBinance->futuresDeliveryPrice($this->symbol);
722
+ // $this->assertIsArray($res);
723
+ // $this->assertIsArray($res[0]);
724
+ // $this->assertArrayHasKey('deliveryTime', $res[0]);
725
+ // $this->assertIsInt($res[0]['deliveryTime']);
726
+ // $this->assertArrayHasKey('deliveryPrice', $res[0]);
727
+ // $this->assertIsNumeric($res[0]['deliveryPrice']);
728
+ // $this->futuresBinance->useTestnet = true; // reset to true for other tests
729
+ // }
729
730
730
731
public function testOpenInterestFutures ()
731
732
{
@@ -738,127 +739,127 @@ public function testOpenInterestFutures()
738
739
$ this ->assertIsInt ($ res ['time ' ]);
739
740
}
740
741
741
- public function testOpenInterestHistoryFutures ()
742
- {
743
- $ this ->futuresBinance ->useTestnet = false ; // set to false for fapiData request
744
- $ res = $ this ->futuresBinance ->futuresOpenInterestHistory ($ this ->symbol , $ this ->period , $ this ->limit );
745
- $ this ->assertIsArray ($ res );
746
- $ entry = $ res [0 ];
747
- $ this ->assertIsArray ($ entry );
748
- $ this ->assertArrayHasKey ('symbol ' , $ entry );
749
- $ this ->assertEquals ($ this ->symbol , $ entry ['symbol ' ]);
750
- $ this ->assertArrayHasKey ('sumOpenInterest ' , $ entry );
751
- $ this ->assertIsNumeric ($ entry ['sumOpenInterest ' ]);
752
- $ this ->assertArrayHasKey ('sumOpenInterestValue ' , $ entry );
753
- $ this ->assertIsNumeric ($ entry ['sumOpenInterestValue ' ]);
754
- $ this ->assertArrayHasKey ('timestamp ' , $ entry );
755
- $ this ->assertIsInt ($ entry ['timestamp ' ]);
756
- $ this ->futuresBinance ->useTestnet = true ; // reset to true for other tests
757
- }
742
+ // public function testOpenInterestHistoryFutures() // Could throw an error if useTestnet is set to false
743
+ // {
744
+ // $this->futuresBinance->useTestnet = false; // set to false for fapiData request
745
+ // $res = $this->futuresBinance->futuresOpenInterestHistory($this->symbol, $this->period, $this->limit);
746
+ // $this->assertIsArray($res);
747
+ // $entry = $res[0];
748
+ // $this->assertIsArray($entry);
749
+ // $this->assertArrayHasKey('symbol', $entry);
750
+ // $this->assertEquals($this->symbol, $entry['symbol']);
751
+ // $this->assertArrayHasKey('sumOpenInterest', $entry);
752
+ // $this->assertIsNumeric($entry['sumOpenInterest']);
753
+ // $this->assertArrayHasKey('sumOpenInterestValue', $entry);
754
+ // $this->assertIsNumeric($entry['sumOpenInterestValue']);
755
+ // $this->assertArrayHasKey('timestamp', $entry);
756
+ // $this->assertIsInt($entry['timestamp']);
757
+ // $this->futuresBinance->useTestnet = true; // reset to true for other tests
758
+ // }
758
759
759
- public function testTopLongShortPositionRatioFutures ()
760
- {
761
- $ this ->futuresBinance ->useTestnet = false ; // set to false for fapiData request
762
- $ res = $ this ->futuresBinance ->futuresTopLongShortPositionRatio ($ this ->symbol , $ this ->period , $ this ->limit );
763
- $ this ->assertIsArray ($ res );
764
- $ entry = $ res [0 ];
765
- $ this ->assertIsArray ($ entry );
766
- $ this ->assertArrayHasKey ('symbol ' , $ entry );
767
- $ this ->assertEquals ($ this ->symbol , $ entry ['symbol ' ]);
768
- $ this ->assertArrayHasKey ('longAccount ' , $ entry );
769
- $ this ->assertIsNumeric ($ entry ['longAccount ' ]);
770
- $ this ->assertArrayHasKey ('longShortRatio ' , $ entry );
771
- $ this ->assertIsNumeric ($ entry ['longShortRatio ' ]);
772
- $ this ->assertArrayHasKey ('shortAccount ' , $ entry );
773
- $ this ->assertIsNumeric ($ entry ['shortAccount ' ]);
774
- $ this ->assertArrayHasKey ('timestamp ' , $ entry );
775
- $ this ->assertIsInt ($ entry ['timestamp ' ]);
776
- $ this ->futuresBinance ->useTestnet = true ; // reset to true for other tests
777
- }
760
+ // public function testTopLongShortPositionRatioFutures() // Could throw an error if useTestnet is set to false
761
+ // {
762
+ // $this->futuresBinance->useTestnet = false; // set to false for fapiData request
763
+ // $res = $this->futuresBinance->futuresTopLongShortPositionRatio($this->symbol, $this->period, $this->limit);
764
+ // $this->assertIsArray($res);
765
+ // $entry = $res[0];
766
+ // $this->assertIsArray($entry);
767
+ // $this->assertArrayHasKey('symbol', $entry);
768
+ // $this->assertEquals($this->symbol, $entry['symbol']);
769
+ // $this->assertArrayHasKey('longAccount', $entry);
770
+ // $this->assertIsNumeric($entry['longAccount']);
771
+ // $this->assertArrayHasKey('longShortRatio', $entry);
772
+ // $this->assertIsNumeric($entry['longShortRatio']);
773
+ // $this->assertArrayHasKey('shortAccount', $entry);
774
+ // $this->assertIsNumeric($entry['shortAccount']);
775
+ // $this->assertArrayHasKey('timestamp', $entry);
776
+ // $this->assertIsInt($entry['timestamp']);
777
+ // $this->futuresBinance->useTestnet = true; // reset to true for other tests
778
+ // }
778
779
779
- public function testTopLongShortAccountRatioFutures ()
780
- {
781
- $ this ->futuresBinance ->useTestnet = false ; // set to false for fapiData request
782
- $ res = $ this ->futuresBinance ->futuresTopLongShortAccountRatio ($ this ->symbol , $ this ->period , $ this ->limit );
783
- $ this ->assertIsArray ($ res );
784
- $ entry = $ res [0 ];
785
- $ this ->assertIsArray ($ entry );
786
- $ this ->assertArrayHasKey ('symbol ' , $ entry );
787
- $ this ->assertEquals ($ this ->symbol , $ entry ['symbol ' ]);
788
- $ this ->assertArrayHasKey ('longAccount ' , $ entry );
789
- $ this ->assertIsNumeric ($ entry ['longAccount ' ]);
790
- $ this ->assertArrayHasKey ('longShortRatio ' , $ entry );
791
- $ this ->assertIsNumeric ($ entry ['longShortRatio ' ]);
792
- $ this ->assertArrayHasKey ('shortAccount ' , $ entry );
793
- $ this ->assertIsNumeric ($ entry ['shortAccount ' ]);
794
- $ this ->assertArrayHasKey ('timestamp ' , $ entry );
795
- $ this ->assertIsInt ($ entry ['timestamp ' ]);
796
- $ this ->futuresBinance ->useTestnet = true ; // reset to true for other tests
797
- }
780
+ // public function testTopLongShortAccountRatioFutures() // Could throw an error if useTestnet is set to false
781
+ // {
782
+ // $this->futuresBinance->useTestnet = false; // set to false for fapiData request
783
+ // $res = $this->futuresBinance->futuresTopLongShortAccountRatio($this->symbol, $this->period, $this->limit);
784
+ // $this->assertIsArray($res);
785
+ // $entry = $res[0];
786
+ // $this->assertIsArray($entry);
787
+ // $this->assertArrayHasKey('symbol', $entry);
788
+ // $this->assertEquals($this->symbol, $entry['symbol']);
789
+ // $this->assertArrayHasKey('longAccount', $entry);
790
+ // $this->assertIsNumeric($entry['longAccount']);
791
+ // $this->assertArrayHasKey('longShortRatio', $entry);
792
+ // $this->assertIsNumeric($entry['longShortRatio']);
793
+ // $this->assertArrayHasKey('shortAccount', $entry);
794
+ // $this->assertIsNumeric($entry['shortAccount']);
795
+ // $this->assertArrayHasKey('timestamp', $entry);
796
+ // $this->assertIsInt($entry['timestamp']);
797
+ // $this->futuresBinance->useTestnet = true; // reset to true for other tests
798
+ // }
798
799
799
- public function testGlobalLongShortAccountRatioFutures ()
800
- {
801
- $ this ->futuresBinance ->useTestnet = false ; // set to false for fapiData request
802
- $ res = $ this ->futuresBinance ->futuresGlobalLongShortAccountRatio ($ this ->symbol , $ this ->period , $ this ->limit );
803
- $ this ->assertIsArray ($ res );
804
- $ entry = $ res [0 ];
805
- $ this ->assertIsArray ($ entry );
806
- $ this ->assertArrayHasKey ('symbol ' , $ entry );
807
- $ this ->assertEquals ($ this ->symbol , $ entry ['symbol ' ]);
808
- $ this ->assertArrayHasKey ('longAccount ' , $ entry );
809
- $ this ->assertIsNumeric ($ entry ['longAccount ' ]);
810
- $ this ->assertArrayHasKey ('longShortRatio ' , $ entry );
811
- $ this ->assertIsNumeric ($ entry ['longShortRatio ' ]);
812
- $ this ->assertArrayHasKey ('shortAccount ' , $ entry );
813
- $ this ->assertIsNumeric ($ entry ['shortAccount ' ]);
814
- $ this ->assertArrayHasKey ('timestamp ' , $ entry );
815
- $ this ->assertIsInt ($ entry ['timestamp ' ]);
816
- $ this ->futuresBinance ->useTestnet = true ; // reset to true for other tests
817
- }
800
+ // public function testGlobalLongShortAccountRatioFutures() // Could throw an error if useTestnet is set to false
801
+ // {
802
+ // $this->futuresBinance->useTestnet = false; // set to false for fapiData request
803
+ // $res = $this->futuresBinance->futuresGlobalLongShortAccountRatio($this->symbol, $this->period, $this->limit);
804
+ // $this->assertIsArray($res);
805
+ // $entry = $res[0];
806
+ // $this->assertIsArray($entry);
807
+ // $this->assertArrayHasKey('symbol', $entry);
808
+ // $this->assertEquals($this->symbol, $entry['symbol']);
809
+ // $this->assertArrayHasKey('longAccount', $entry);
810
+ // $this->assertIsNumeric($entry['longAccount']);
811
+ // $this->assertArrayHasKey('longShortRatio', $entry);
812
+ // $this->assertIsNumeric($entry['longShortRatio']);
813
+ // $this->assertArrayHasKey('shortAccount', $entry);
814
+ // $this->assertIsNumeric($entry['shortAccount']);
815
+ // $this->assertArrayHasKey('timestamp', $entry);
816
+ // $this->assertIsInt($entry['timestamp']);
817
+ // $this->futuresBinance->useTestnet = true; // reset to true for other tests
818
+ // }
818
819
819
- public function testTakerLongShortRatioFutures ()
820
- {
821
- $ this ->futuresBinance ->useTestnet = false ; // set to false for fapiData request
822
- $ res = $ this ->futuresBinance ->futuresTakerLongShortRatio ($ this ->symbol , $ this ->period , $ this ->limit );
823
- $ this ->assertIsArray ($ res );
824
- $ entry = $ res [0 ];
825
- $ this ->assertIsArray ($ entry );
826
- $ this ->assertArrayHasKey ('buySellRatio ' , $ entry );
827
- $ this ->assertIsNumeric ($ entry ['buySellRatio ' ]);
828
- $ this ->assertArrayHasKey ('sellVol ' , $ entry );
829
- $ this ->assertIsNumeric ($ entry ['sellVol ' ]);
830
- $ this ->assertArrayHasKey ('buyVol ' , $ entry );
831
- $ this ->assertIsNumeric ($ entry ['buyVol ' ]);
832
- $ this ->assertArrayHasKey ('timestamp ' , $ entry );
833
- $ this ->assertIsInt ($ entry ['timestamp ' ]);
834
- $ this ->futuresBinance ->useTestnet = true ; // reset to true for other tests
835
- }
820
+ // public function testTakerLongShortRatioFutures() // Could throw an error if useTestnet is set to false
821
+ // {
822
+ // $this->futuresBinance->useTestnet = false; // set to false for fapiData request
823
+ // $res = $this->futuresBinance->futuresTakerLongShortRatio($this->symbol, $this->period, $this->limit);
824
+ // $this->assertIsArray($res);
825
+ // $entry = $res[0];
826
+ // $this->assertIsArray($entry);
827
+ // $this->assertArrayHasKey('buySellRatio', $entry);
828
+ // $this->assertIsNumeric($entry['buySellRatio']);
829
+ // $this->assertArrayHasKey('sellVol', $entry);
830
+ // $this->assertIsNumeric($entry['sellVol']);
831
+ // $this->assertArrayHasKey('buyVol', $entry);
832
+ // $this->assertIsNumeric($entry['buyVol']);
833
+ // $this->assertArrayHasKey('timestamp', $entry);
834
+ // $this->assertIsInt($entry['timestamp']);
835
+ // $this->futuresBinance->useTestnet = true; // reset to true for other tests
836
+ // }
836
837
837
- public function testBasisFutures ()
838
- {
839
- $ this ->futuresBinance ->useTestnet = false ; // set to false for fapiData request
840
- $ res = $ this ->futuresBinance ->futuresBasis ($ this ->symbol , $ this ->period , $ this ->limit , null , null , $ this ->contractType );
841
- $ this ->assertIsArray ($ res );
842
- $ entry = $ res [0 ];
843
- $ this ->assertIsArray ($ entry );
844
- $ this ->assertArrayHasKey ('indexPrice ' , $ entry );
845
- $ this ->assertIsNumeric ($ entry ['indexPrice ' ]);
846
- $ this ->assertArrayHasKey ('contractType ' , $ entry );
847
- $ this ->assertEquals ($ this ->contractType , $ entry ['contractType ' ]);
848
- $ this ->assertArrayHasKey ('basisRate ' , $ entry );
849
- $ this ->assertIsNumeric ($ entry ['basisRate ' ]);
850
- $ this ->assertArrayHasKey ('futuresPrice ' , $ entry );
851
- $ this ->assertIsNumeric ($ entry ['futuresPrice ' ]);
852
- $ this ->assertArrayHasKey ('annualizedBasisRate ' , $ entry );
853
- $ this ->assertIsNumeric ($ entry ['annualizedBasisRate ' ]);
854
- $ this ->assertArrayHasKey ('basis ' , $ entry );
855
- $ this ->assertIsNumeric ($ entry ['basis ' ]);
856
- $ this ->assertArrayHasKey ('pair ' , $ entry );
857
- $ this ->assertEquals ($ this ->symbol , $ entry ['pair ' ]);
858
- $ this ->assertArrayHasKey ('timestamp ' , $ entry );
859
- $ this ->assertIsInt ($ entry ['timestamp ' ]);
860
- $ this ->futuresBinance ->useTestnet = true ; // reset to true for other tests
861
- }
838
+ // public function testBasisFutures() // Could throw an error if useTestnet is set to false
839
+ // {
840
+ // $this->futuresBinance->useTestnet = false; // set to false for fapiData request
841
+ // $res = $this->futuresBinance->futuresBasis($this->symbol, $this->period, $this->limit, null, null, $this->contractType);
842
+ // $this->assertIsArray($res);
843
+ // $entry = $res[0];
844
+ // $this->assertIsArray($entry);
845
+ // $this->assertArrayHasKey('indexPrice', $entry);
846
+ // $this->assertIsNumeric($entry['indexPrice']);
847
+ // $this->assertArrayHasKey('contractType', $entry);
848
+ // $this->assertEquals($this->contractType, $entry['contractType']);
849
+ // $this->assertArrayHasKey('basisRate', $entry);
850
+ // $this->assertIsNumeric($entry['basisRate']);
851
+ // $this->assertArrayHasKey('futuresPrice', $entry);
852
+ // $this->assertIsNumeric($entry['futuresPrice']);
853
+ // $this->assertArrayHasKey('annualizedBasisRate', $entry);
854
+ // $this->assertIsNumeric($entry['annualizedBasisRate']);
855
+ // $this->assertArrayHasKey('basis', $entry);
856
+ // $this->assertIsNumeric($entry['basis']);
857
+ // $this->assertArrayHasKey('pair', $entry);
858
+ // $this->assertEquals($this->symbol, $entry['pair']);
859
+ // $this->assertArrayHasKey('timestamp', $entry);
860
+ // $this->assertIsInt($entry['timestamp']);
861
+ // $this->futuresBinance->useTestnet = true; // reset to true for other tests
862
+ // }
862
863
863
864
public function testIndexInfoFutures ()
864
865
{
@@ -914,4 +915,103 @@ public function testConstituentsFutures()
914
915
$ this ->assertArrayHasKey ('constituents ' , $ res );
915
916
$ this ->assertIsArray ($ res ['constituents ' ]);
916
917
}
918
+
919
+ public function testOrderAmendmentFutures ()
920
+ {
921
+ $ res = $ this ->futuresBinance ->futuresOrderAmendment ($ this ->symbol );
922
+ $ this ->assertIsArray ($ res );
923
+ }
924
+
925
+ public function testCountdownCancelAllOrdersFutures ()
926
+ {
927
+ $ countdownTime = 1000 ;
928
+ $ res = $ this ->futuresBinance ->futuresCountdownCancelAllOrders ($ this ->symbol , $ countdownTime );
929
+ $ this ->assertIsArray ($ res );
930
+ $ this ->assertArrayHasKey ('symbol ' , $ res );
931
+ $ this ->assertEquals ($ this ->symbol , $ res ['symbol ' ]);
932
+ $ this ->assertArrayHasKey ('countdownTime ' , $ res );
933
+ $ this ->assertEquals ($ countdownTime , $ res ['countdownTime ' ]);
934
+ }
935
+
936
+ public function testAllOrdersFutures ()
937
+ {
938
+ $ res = $ this ->futuresBinance ->futuresAllOrders ($ this ->symbol );
939
+ $ this ->assertIsArray ($ res );
940
+ }
941
+
942
+ public function testOpenOrdersFutures ()
943
+ {
944
+ $ res = $ this ->futuresBinance ->futuresOpenOrders ($ this ->symbol );
945
+ $ this ->assertIsArray ($ res );
946
+ }
947
+
948
+ public function testForceOrdersFutures ()
949
+ {
950
+ $ res = $ this ->futuresBinance ->futuresForceOrders ();
951
+ $ this ->assertIsArray ($ res );
952
+ }
953
+
954
+ public function testMyTradesFutures ()
955
+ {
956
+ $ res = $ this ->futuresBinance ->futuresMyTrades ($ this ->symbol );
957
+ $ this ->assertIsArray ($ res );
958
+ }
959
+
960
+ public function testHistoryFutures ()
961
+ {
962
+ $ res = $ this ->futuresBinance ->futuresHistory ($ this ->symbol );
963
+ $ this ->assertIsArray ($ res );
964
+ }
965
+
966
+ public function testPositionModeFutures ()
967
+ {
968
+ $ res = $ this ->futuresBinance ->futuresPositionMode ();
969
+ $ this ->assertIsArray ($ res );
970
+ $ this ->assertArrayHasKey ('dualSidePosition ' , $ res );
971
+ $ this ->assertIsBool ($ res ['dualSidePosition ' ]);
972
+ }
973
+
974
+ public function testMultiAssetsMarginModeFutures ()
975
+ {
976
+ $ res = $ this ->futuresBinance ->futuresMultiAssetsMarginMode ();
977
+ $ this ->assertIsArray ($ res );
978
+ $ this ->assertArrayHasKey ('multiAssetsMargin ' , $ res );
979
+ $ this ->assertIsBool ($ res ['multiAssetsMargin ' ]);
980
+ }
981
+
982
+ public function testPositionsFutures ()
983
+ {
984
+ $ res = $ this ->futuresBinance ->futuresPositions ($ this ->symbol );
985
+ $ this ->assertIsArray ($ res );
986
+ }
987
+
988
+ public function testPositionsV2Futures ()
989
+ {
990
+ $ res = $ this ->futuresBinance ->futuresPositionsV2 ($ this ->symbol );
991
+ $ this ->assertIsArray ($ res );
992
+ }
993
+
994
+ public function testPositionsV3Futures ()
995
+ {
996
+ $ res = $ this ->futuresBinance ->futuresPositionsV3 ($ this ->symbol );
997
+ $ this ->assertIsArray ($ res );
998
+ }
999
+
1000
+ public function testPositionFutures ()
1001
+ {
1002
+ $ res = $ this ->futuresBinance ->futuresPosition ($ this ->symbol );
1003
+ $ this ->assertIsArray ($ res );
1004
+ }
1005
+
1006
+ public function testPositionV2Futures ()
1007
+ {
1008
+ $ res = $ this ->futuresBinance ->futuresPositionV2 ($ this ->symbol );
1009
+ $ this ->assertIsArray ($ res );
1010
+ }
1011
+
1012
+ public function testPositionV3Futures ()
1013
+ {
1014
+ $ res = $ this ->futuresBinance ->futuresPositionV3 ($ this ->symbol );
1015
+ $ this ->assertIsArray ($ res );
1016
+ }
917
1017
}
0 commit comments