Fix styling
This commit is contained in:
1 parent
38114203a1
commit
526ef64ad8
10 files changed
+151
-154
No files matched your search
@@ -14,7 +14,7 @@ beforeEach(function () {
|
||||
it('can flash close position successfully', function () {
|
||||
$api = app(FlashClosePositionRequestContract::class);
|
||||
|
||||
expect(fn() => $api->flashClosePosition('19848247723672'))
|
||||
expect(fn () => $api->flashClosePosition('19848247723672'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -22,9 +22,9 @@ it('validates required position ID parameter', function () {
|
||||
$api = app(FlashClosePositionRequestContract::class);
|
||||
|
||||
// Test with valid position ID
|
||||
expect(fn() => $api->flashClosePosition('19848247723672'))
|
||||
expect(fn () => $api->flashClosePosition('19848247723672'))
|
||||
->not->toThrow(Exception::class)
|
||||
->and(fn() => $api->flashClosePosition('123456789'))
|
||||
->and(fn () => $api->flashClosePosition('123456789'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -36,11 +36,11 @@ it('can handle different position ID formats', function () {
|
||||
'123456789',
|
||||
'987654321',
|
||||
'position-123',
|
||||
'pos_456'
|
||||
'pos_456',
|
||||
];
|
||||
|
||||
foreach ($positionIds as $positionId) {
|
||||
expect(fn() => $api->flashClosePosition($positionId))
|
||||
expect(fn () => $api->flashClosePosition($positionId))
|
||||
->not->toThrow(Exception::class);
|
||||
}
|
||||
});
|
||||
@@ -49,9 +49,9 @@ it('validates position ID parameter type', function () {
|
||||
$api = app(FlashClosePositionRequestContract::class);
|
||||
|
||||
// Test with string position ID
|
||||
expect(fn() => $api->flashClosePosition('19848247723672'))
|
||||
expect(fn () => $api->flashClosePosition('19848247723672'))
|
||||
->not->toThrow(Exception::class)
|
||||
->and(fn() => $api->flashClosePosition('123456789'))
|
||||
->and(fn () => $api->flashClosePosition('123456789'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -59,9 +59,9 @@ it('can handle edge cases for position ID', function () {
|
||||
$api = app(FlashClosePositionRequestContract::class);
|
||||
|
||||
// Test with long position ID
|
||||
expect(fn() => $api->flashClosePosition('198482477236721234567890'))
|
||||
expect(fn () => $api->flashClosePosition('198482477236721234567890'))
|
||||
->not->toThrow(Exception::class)
|
||||
->and(fn() => $api->flashClosePosition('123'))
|
||||
->and(fn () => $api->flashClosePosition('123'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -77,7 +77,7 @@ it('can handle multiple flash close position calls', function () {
|
||||
$positionIds = ['19848247723672', '19848247723673', '19848247723674'];
|
||||
|
||||
foreach ($positionIds as $positionId) {
|
||||
expect(fn() => $api->flashClosePosition($positionId))
|
||||
expect(fn () => $api->flashClosePosition($positionId))
|
||||
->not->toThrow(Exception::class);
|
||||
}
|
||||
});
|
||||
@@ -87,7 +87,7 @@ it('validates flash close position response structure', function () {
|
||||
|
||||
// This test verifies the method can be called without throwing exceptions
|
||||
// The actual response structure will be validated by the API
|
||||
expect(fn() => $api->flashClosePosition('19848247723672'))
|
||||
expect(fn () => $api->flashClosePosition('19848247723672'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -95,9 +95,9 @@ it('can handle special characters in position ID', function () {
|
||||
$api = app(FlashClosePositionRequestContract::class);
|
||||
|
||||
// Test with position ID containing special characters
|
||||
expect(fn() => $api->flashClosePosition('pos-123_456'))
|
||||
expect(fn () => $api->flashClosePosition('pos-123_456'))
|
||||
->not->toThrow(Exception::class)
|
||||
->and(fn() => $api->flashClosePosition('pos.123.456'))
|
||||
->and(fn () => $api->flashClosePosition('pos.123.456'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -106,6 +106,6 @@ it('validates flash close position with empty string', function () {
|
||||
|
||||
// This should not throw an exception at the method level
|
||||
// The API will handle validation
|
||||
expect(fn() => $api->flashClosePosition(''))
|
||||
expect(fn () => $api->flashClosePosition(''))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
@@ -14,28 +14,28 @@ beforeEach(function () {
|
||||
it('can get all pending positions', function () {
|
||||
$api = app(GetPendingPositionsRequestContract::class);
|
||||
|
||||
expect(fn() => $api->getPendingPositions())
|
||||
expect(fn () => $api->getPendingPositions())
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
it('can get pending positions by symbol', function () {
|
||||
$api = app(GetPendingPositionsRequestContract::class);
|
||||
|
||||
expect(fn() => $api->getPendingPositions('BTCUSDT'))
|
||||
expect(fn () => $api->getPendingPositions('BTCUSDT'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
it('can get pending positions by position ID', function () {
|
||||
$api = app(GetPendingPositionsRequestContract::class);
|
||||
|
||||
expect(fn() => $api->getPendingPositions(null, '19848247723672'))
|
||||
expect(fn () => $api->getPendingPositions(null, '19848247723672'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
it('can get pending positions with both symbol and position ID', function () {
|
||||
$api = app(GetPendingPositionsRequestContract::class);
|
||||
|
||||
expect(fn() => $api->getPendingPositions('BTCUSDT', '19848247723672'))
|
||||
expect(fn () => $api->getPendingPositions('BTCUSDT', '19848247723672'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -43,15 +43,15 @@ it('validates required parameters for get pending positions', function () {
|
||||
$api = app(GetPendingPositionsRequestContract::class);
|
||||
|
||||
// Test without parameters
|
||||
expect(fn() => $api->getPendingPositions())
|
||||
expect(fn () => $api->getPendingPositions())
|
||||
->not->toThrow(Exception::class);
|
||||
|
||||
// Test with symbol only
|
||||
expect(fn() => $api->getPendingPositions('BTCUSDT'))
|
||||
expect(fn () => $api->getPendingPositions('BTCUSDT'))
|
||||
->not->toThrow(Exception::class);
|
||||
|
||||
// Test with position ID only
|
||||
expect(fn() => $api->getPendingPositions(null, '19848247723672'))
|
||||
expect(fn () => $api->getPendingPositions(null, '19848247723672'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -61,7 +61,7 @@ it('can handle different trading pairs', function () {
|
||||
$tradingPairs = ['BTCUSDT', 'ETHUSDT', 'ADAUSDT'];
|
||||
|
||||
foreach ($tradingPairs as $symbol) {
|
||||
expect(fn() => $api->getPendingPositions($symbol))
|
||||
expect(fn () => $api->getPendingPositions($symbol))
|
||||
->not->toThrow(Exception::class);
|
||||
}
|
||||
});
|
||||
@@ -74,11 +74,11 @@ it('can handle different position ID formats', function () {
|
||||
'123456789',
|
||||
'987654321',
|
||||
'position-123',
|
||||
'pos_456'
|
||||
'pos_456',
|
||||
];
|
||||
|
||||
foreach ($positionIds as $positionId) {
|
||||
expect(fn() => $api->getPendingPositions(null, $positionId))
|
||||
expect(fn () => $api->getPendingPositions(null, $positionId))
|
||||
->not->toThrow(Exception::class);
|
||||
}
|
||||
});
|
||||
@@ -93,11 +93,11 @@ it('can handle edge cases for parameters', function () {
|
||||
$api = app(GetPendingPositionsRequestContract::class);
|
||||
|
||||
// Test with empty string symbol
|
||||
expect(fn() => $api->getPendingPositions(''))
|
||||
expect(fn () => $api->getPendingPositions(''))
|
||||
->not->toThrow(Exception::class);
|
||||
|
||||
// Test with empty string position ID
|
||||
expect(fn() => $api->getPendingPositions(null, ''))
|
||||
expect(fn () => $api->getPendingPositions(null, ''))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -105,11 +105,11 @@ it('can handle special characters in parameters', function () {
|
||||
$api = app(GetPendingPositionsRequestContract::class);
|
||||
|
||||
// Test with special characters in symbol
|
||||
expect(fn() => $api->getPendingPositions('BTC-USDT'))
|
||||
expect(fn () => $api->getPendingPositions('BTC-USDT'))
|
||||
->not->toThrow(Exception::class);
|
||||
|
||||
// Test with special characters in position ID
|
||||
expect(fn() => $api->getPendingPositions(null, 'pos-123_456'))
|
||||
expect(fn () => $api->getPendingPositions(null, 'pos-123_456'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -118,7 +118,7 @@ it('validates get pending positions response structure', function () {
|
||||
|
||||
// This test verifies the method can be called without throwing exceptions
|
||||
// The actual response structure will be validated by the API
|
||||
expect(fn() => $api->getPendingPositions())
|
||||
expect(fn () => $api->getPendingPositions())
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -128,7 +128,7 @@ it('can handle multiple get pending positions calls', function () {
|
||||
$symbols = ['BTCUSDT', 'ETHUSDT', 'ADAUSDT'];
|
||||
|
||||
foreach ($symbols as $symbol) {
|
||||
expect(fn() => $api->getPendingPositions($symbol))
|
||||
expect(fn () => $api->getPendingPositions($symbol))
|
||||
->not->toThrow(Exception::class);
|
||||
}
|
||||
});
|
||||
@@ -139,11 +139,11 @@ it('can handle combination of symbol and position ID', function () {
|
||||
$combinations = [
|
||||
['BTCUSDT', '19848247723672'],
|
||||
['ETHUSDT', '19848247723673'],
|
||||
['ADAUSDT', '19848247723674']
|
||||
['ADAUSDT', '19848247723674'],
|
||||
];
|
||||
|
||||
foreach ($combinations as [$symbol, $positionId]) {
|
||||
expect(fn() => $api->getPendingPositions($symbol, $positionId))
|
||||
expect(fn () => $api->getPendingPositions($symbol, $positionId))
|
||||
->not->toThrow(Exception::class);
|
||||
}
|
||||
});
|
||||
@@ -14,7 +14,7 @@ beforeEach(function () {
|
||||
it('can get single account successfully', function () {
|
||||
$api = app(GetSingleAccountRequestContract::class);
|
||||
|
||||
expect(fn() => $api->getSingleAccount('USDT'))
|
||||
expect(fn () => $api->getSingleAccount('USDT'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -22,11 +22,11 @@ it('validates required margin coin parameter', function () {
|
||||
$api = app(GetSingleAccountRequestContract::class);
|
||||
|
||||
// Test with valid margin coin
|
||||
expect(fn() => $api->getSingleAccount('USDT'))
|
||||
expect(fn () => $api->getSingleAccount('USDT'))
|
||||
->not->toThrow(Exception::class);
|
||||
|
||||
// Test with different margin coins
|
||||
expect(fn() => $api->getSingleAccount('BTC'))
|
||||
expect(fn () => $api->getSingleAccount('BTC'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -36,7 +36,7 @@ it('can handle different margin coins', function () {
|
||||
$marginCoins = ['USDT', 'BTC', 'ETH', 'BNB', 'ADA'];
|
||||
|
||||
foreach ($marginCoins as $marginCoin) {
|
||||
expect(fn() => $api->getSingleAccount($marginCoin))
|
||||
expect(fn () => $api->getSingleAccount($marginCoin))
|
||||
->not->toThrow(Exception::class);
|
||||
}
|
||||
});
|
||||
@@ -51,11 +51,11 @@ it('can handle edge cases for margin coin', function () {
|
||||
$api = app(GetSingleAccountRequestContract::class);
|
||||
|
||||
// Test with uppercase margin coin
|
||||
expect(fn() => $api->getSingleAccount('USDT'))
|
||||
expect(fn () => $api->getSingleAccount('USDT'))
|
||||
->not->toThrow(Exception::class);
|
||||
|
||||
// Test with lowercase margin coin
|
||||
expect(fn() => $api->getSingleAccount('usdt'))
|
||||
expect(fn () => $api->getSingleAccount('usdt'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -64,7 +64,7 @@ it('validates get single account response structure', function () {
|
||||
|
||||
// This test verifies the method can be called without throwing exceptions
|
||||
// The actual response structure will be validated by the API
|
||||
expect(fn() => $api->getSingleAccount('USDT'))
|
||||
expect(fn () => $api->getSingleAccount('USDT'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -74,7 +74,7 @@ it('can handle multiple get single account calls', function () {
|
||||
$marginCoins = ['USDT', 'BTC', 'ETH'];
|
||||
|
||||
foreach ($marginCoins as $marginCoin) {
|
||||
expect(fn() => $api->getSingleAccount($marginCoin))
|
||||
expect(fn () => $api->getSingleAccount($marginCoin))
|
||||
->not->toThrow(Exception::class);
|
||||
}
|
||||
});
|
||||
@@ -83,11 +83,11 @@ it('validates margin coin parameter type', function () {
|
||||
$api = app(GetSingleAccountRequestContract::class);
|
||||
|
||||
// Test with string margin coin
|
||||
expect(fn() => $api->getSingleAccount('USDT'))
|
||||
expect(fn () => $api->getSingleAccount('USDT'))
|
||||
->not->toThrow(Exception::class);
|
||||
|
||||
// Test with different string formats
|
||||
expect(fn() => $api->getSingleAccount('BTC'))
|
||||
expect(fn () => $api->getSingleAccount('BTC'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -95,11 +95,11 @@ it('can handle special characters in margin coin', function () {
|
||||
$api = app(GetSingleAccountRequestContract::class);
|
||||
|
||||
// Test with margin coin containing special characters
|
||||
expect(fn() => $api->getSingleAccount('USDT'))
|
||||
expect(fn () => $api->getSingleAccount('USDT'))
|
||||
->not->toThrow(Exception::class);
|
||||
|
||||
// Test with margin coin containing numbers
|
||||
expect(fn() => $api->getSingleAccount('USDT'))
|
||||
expect(fn () => $api->getSingleAccount('USDT'))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
|
||||
@@ -108,6 +108,6 @@ it('validates get single account with empty string', function () {
|
||||
|
||||
// This should not throw an exception at the method level
|
||||
// The API will handle validation
|
||||
expect(fn() => $api->getSingleAccount(''))
|
||||
expect(fn () => $api->getSingleAccount(''))
|
||||
->not->toThrow(Exception::class);
|
||||
});
|
||||
Reference in new issue
Block a user