1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Xsolla\SDK\Tests\Integration\API; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* @group api |
7
|
|
|
*/ |
8
|
|
|
class GameDeliveryTest extends AbstractAPITest |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* @var int |
12
|
|
|
*/ |
13
|
|
|
protected static $gameDeliveryEntityId; |
14
|
|
|
|
15
|
|
|
private $gameDeliveryEntityTemplate = array( |
16
|
|
|
'sku' => 'sdk-test', |
17
|
|
|
'name' => array( |
18
|
|
|
'en' => 'sdk-test name-en', |
19
|
|
|
), |
20
|
|
|
'description' => array( |
21
|
|
|
'en' => 'sdk-test description-en', |
22
|
|
|
), |
23
|
|
|
'system_requirements' => 'sdk-test system_requirements', |
24
|
|
|
'default_currency' => 'USD', |
25
|
|
|
'drm' => array( |
26
|
|
|
array( |
27
|
|
|
'id' => 1, |
28
|
|
|
'platforms' => array( |
29
|
|
|
array( |
30
|
|
|
'id' => 1, |
31
|
|
|
), |
32
|
|
|
), |
33
|
|
|
), |
34
|
|
|
), |
35
|
|
|
); |
36
|
|
|
|
37
|
|
|
public static function setUpBeforeClass() |
38
|
|
|
{ |
39
|
|
|
parent::setUpBeforeClass(); |
40
|
|
|
static::$gameDeliveryEntityId = (int) getenv('GAME_DELIVERY_ENTITY_ID'); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
public function testListGameDeliveryDrmPlatforms() |
44
|
|
|
{ |
45
|
|
|
$response = static::$xsollaClient->ListGameDeliveryDrmPlatforms(); |
46
|
|
|
static::assertArrayHasKey('platforms', $response); |
47
|
|
|
static::assertArrayHasKey('drm', $response); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function testCreateGameDeliveryEntity() |
51
|
|
|
{ |
52
|
|
|
static::markTestIncomplete('Delete game delivery entity API method not implemented yet. We should not create new entities infinitely.'); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function testListGameDeliveryEntities() |
56
|
|
|
{ |
57
|
|
|
$response = static::$xsollaClient->ListGameDeliveryEntities(array( |
58
|
|
|
'project_id' => static::$projectId, |
59
|
|
|
)); |
60
|
|
|
static::assertInternalType('array', $response); |
61
|
|
|
static::assertArrayHasKey('id', current($response)); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function testGetGameDeliveryEntity() |
65
|
|
|
{ |
66
|
|
|
$response = static::$xsollaClient->GetGameDeliveryEntity(array( |
67
|
|
|
'project_id' => static::$projectId, |
68
|
|
|
'game_delivery_id' => static::$gameDeliveryEntityId, |
69
|
|
|
)); |
70
|
|
|
static::assertSame(static::$gameDeliveryEntityId, $response['id']); |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
public function testUpdateGameDeliveryEntity() |
74
|
|
|
{ |
75
|
|
|
static::$xsollaClient->UpdateGameDeliveryEntity(array( |
76
|
|
|
'project_id' => static::$projectId, |
77
|
|
|
'game_delivery_id' => static::$gameDeliveryEntityId, |
78
|
|
|
'request' => $this->gameDeliveryEntityTemplate, |
79
|
|
|
)); |
80
|
|
|
} |
81
|
|
|
} |
82
|
|
|
|