1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Carpenstar\ByBitAPI\Spot\MarketData\LastTradedPrice\Tests; |
4
|
|
|
|
5
|
|
|
use Carpenstar\ByBitAPI\BybitAPI; |
6
|
|
|
use Carpenstar\ByBitAPI\Core\Builders\ResponseDtoBuilder; |
7
|
|
|
use Carpenstar\ByBitAPI\Core\Builders\ResponseHandlerBuilder; |
8
|
|
|
use Carpenstar\ByBitAPI\Core\Builders\RestBuilder; |
9
|
|
|
use Carpenstar\ByBitAPI\Core\Enums\EnumOutputMode; |
10
|
|
|
use Carpenstar\ByBitAPI\Core\Objects\Collection\EntityCollection; |
11
|
|
|
use Carpenstar\ByBitAPI\Core\Response\CurlResponseDto; |
|
|
|
|
12
|
|
|
use Carpenstar\ByBitAPI\Core\Response\CurlResponseHandler; |
13
|
|
|
use Carpenstar\ByBitAPI\Spot\MarketData\Kline\Response\KlineResponse; |
14
|
|
|
use Carpenstar\ByBitAPI\Spot\MarketData\LastTradedPrice\LastTradedPrice; |
15
|
|
|
use Carpenstar\ByBitAPI\Spot\MarketData\LastTradedPrice\Overrides\TestLastTradedPrice; |
|
|
|
|
16
|
|
|
use Carpenstar\ByBitAPI\Spot\MarketData\LastTradedPrice\Request\LastTradedPriceRequest; |
17
|
|
|
use Carpenstar\ByBitAPI\Spot\MarketData\LastTradedPrice\Response\LastTradedPriceResponse; |
18
|
|
|
use PHPUnit\Framework\TestCase; |
19
|
|
|
|
20
|
|
|
class LastTradedPriceTest extends TestCase |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* Тестирование сборки объекта ответа |
24
|
|
|
* |
25
|
|
|
* @return void |
26
|
|
|
*/ |
27
|
|
|
public function testBuildResponseData() |
28
|
|
|
{ |
29
|
|
|
$json = '{"retCode":0,"retMsg":"OK","result":{"symbol":"BTCUSDT","price":"26386.61"},"retExtInfo":{},"time":1683982585451}'; |
30
|
|
|
$data = (new CurlResponseHandler())->build(json_decode($json, true), LastTradedPriceResponse::class); |
31
|
|
|
|
32
|
|
|
$this->assertEquals(0, $data->getReturnCode()); |
33
|
|
|
$this->assertEquals('OK', $data->getReturnMessage()); |
34
|
|
|
$this->assertInstanceOf(LastTradedPriceResponse::class, $data->getResult()); |
35
|
|
|
|
36
|
|
|
/** @var LastTradedPriceResponse $klineInfo */ |
37
|
|
|
$klineInfo = $data->getResult(); |
38
|
|
|
|
39
|
|
|
$this->assertEquals('BTCUSDT', $klineInfo->getSymbol()); |
40
|
|
|
$this->assertEquals(26386.61, $klineInfo->getPrice()); |
41
|
|
|
} |
42
|
|
|
} |
43
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths