This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Xsolla\SDK\Tests\Integration\API; |
||
4 | |||
5 | /** |
||
6 | * @group api |
||
7 | */ |
||
8 | class VirtualItemsTest extends AbstractAPITest |
||
9 | { |
||
10 | protected static $virtualItemSku; |
||
11 | |||
12 | protected static $virtualItemId; |
||
13 | |||
14 | protected static $virtualItemsGroupId; |
||
15 | |||
16 | protected static $virtualItem; |
||
17 | |||
18 | protected $virtualItemsGroup = [ |
||
19 | 'name' => [ |
||
20 | 'en' => 'Virtual Item Group', |
||
21 | ], |
||
22 | 'description' => [ |
||
23 | 'en' => 'Virtual Item Group Description', |
||
24 | ], |
||
25 | 'enabled' => true, |
||
26 | ]; |
||
27 | |||
28 | public function setUp() |
||
29 | { |
||
30 | parent::setUp(); |
||
31 | if (!static::$virtualItemSku) { |
||
32 | static::$virtualItemSku = uniqid('virtual_item_', false); |
||
33 | static::$virtualItem = $this->generateVirtualItemTemplate(static::$virtualItemSku); |
||
34 | } |
||
35 | } |
||
36 | |||
37 | public function testListVirtualItemsGroups() |
||
38 | { |
||
39 | $response = static::$xsollaClient->ListVirtualItemsGroups([ |
||
40 | 'project_id' => static::$projectId, |
||
41 | ]); |
||
42 | static::assertInternalType('array', $response); |
||
0 ignored issues
–
show
|
|||
43 | } |
||
44 | |||
45 | public function testListVirtualItems() |
||
46 | { |
||
47 | $response = static::$xsollaClient->ListVirtualItems([ |
||
48 | 'project_id' => static::$projectId, |
||
49 | ]); |
||
50 | static::assertInternalType('array', $response); |
||
0 ignored issues
–
show
The method
PHPUnit\Framework\Assert::assertInternalType() has been deprecated with message: https://github.com/sebastianbergmann/phpunit/issues/3369
This method has been deprecated. The supplier of the class has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead. ![]() |
|||
51 | } |
||
52 | |||
53 | View Code Duplication | public function testListVirtualItemsWithParams() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
54 | { |
||
55 | $response = static::$xsollaClient->ListVirtualItems([ |
||
56 | 'project_id' => static::$projectId, |
||
57 | 'offset' => 0, |
||
58 | 'limit' => 100, |
||
59 | 'has_price' => 'virtual_currency', |
||
60 | ]); |
||
61 | static::assertInternalType('array', $response); |
||
0 ignored issues
–
show
The method
PHPUnit\Framework\Assert::assertInternalType() has been deprecated with message: https://github.com/sebastianbergmann/phpunit/issues/3369
This method has been deprecated. The supplier of the class has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead. ![]() |
|||
62 | } |
||
63 | |||
64 | View Code Duplication | public function testCreateVirtualItemsGroup() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
65 | { |
||
66 | $response = static::$xsollaClient->CreateVirtualItemsGroup([ |
||
67 | 'project_id' => static::$projectId, |
||
68 | 'request' => $this->virtualItemsGroup, |
||
69 | ]); |
||
70 | static::assertArrayHasKey('group_id', $response); |
||
71 | static::$virtualItemsGroupId = $response['group_id']; |
||
72 | static::$virtualItem['groups'] = [static::$virtualItemsGroupId]; |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * @depends testCreateVirtualItemsGroup |
||
77 | */ |
||
78 | public function testGetVirtualItemsGroup() |
||
79 | { |
||
80 | $response = static::$xsollaClient->GetVirtualItemsGroup([ |
||
81 | 'project_id' => static::$projectId, |
||
82 | 'group_id' => static::$virtualItemsGroupId, |
||
83 | ]); |
||
84 | static::assertInternalType('array', $response); |
||
0 ignored issues
–
show
The method
PHPUnit\Framework\Assert::assertInternalType() has been deprecated with message: https://github.com/sebastianbergmann/phpunit/issues/3369
This method has been deprecated. The supplier of the class has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead. ![]() |
|||
85 | } |
||
86 | |||
87 | /** |
||
88 | * @depends testGetVirtualItemsGroup |
||
89 | */ |
||
90 | public function testUpdateVirtualItemsGroup() |
||
91 | { |
||
92 | static::$xsollaClient->UpdateVirtualItemsGroup([ |
||
93 | 'project_id' => static::$projectId, |
||
94 | 'group_id' => static::$virtualItemsGroupId, |
||
95 | 'request' => $this->virtualItemsGroup, |
||
96 | ]); |
||
97 | static::assertTrue(true); |
||
98 | } |
||
99 | |||
100 | /** |
||
101 | * @depends testUpdateVirtualItemsGroup |
||
102 | */ |
||
103 | View Code Duplication | public function testCreateVirtualItem() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
104 | { |
||
105 | $response = static::$xsollaClient->CreateVirtualItem([ |
||
106 | 'project_id' => static::$projectId, |
||
107 | 'request' => static::$virtualItem, |
||
108 | ]); |
||
109 | static::assertArrayHasKey('item_id', $response); |
||
110 | static::$virtualItemId = $response['item_id']; |
||
111 | } |
||
112 | |||
113 | /** |
||
114 | * @depends testCreateVirtualItem |
||
115 | */ |
||
116 | public function testGetVirtualItem() |
||
117 | { |
||
118 | $response = static::$xsollaClient->GetVirtualItem([ |
||
119 | 'project_id' => static::$projectId, |
||
120 | 'item_id' => static::$virtualItemId, |
||
121 | ]); |
||
122 | static::assertInternalType('array', $response); |
||
0 ignored issues
–
show
The method
PHPUnit\Framework\Assert::assertInternalType() has been deprecated with message: https://github.com/sebastianbergmann/phpunit/issues/3369
This method has been deprecated. The supplier of the class has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead. ![]() |
|||
123 | } |
||
124 | |||
125 | /** |
||
126 | * @depends testGetVirtualItem |
||
127 | */ |
||
128 | public function testUpdateVirtualItem() |
||
129 | { |
||
130 | static::$xsollaClient->UpdateVirtualItem([ |
||
131 | 'project_id' => static::$projectId, |
||
132 | 'item_id' => static::$virtualItemId, |
||
133 | 'request' => static::$virtualItem, |
||
134 | ]); |
||
135 | static::assertTrue(true); |
||
136 | } |
||
137 | |||
138 | /** |
||
139 | * @depends testUpdateVirtualItemsGroup |
||
140 | */ |
||
141 | View Code Duplication | public function testUpdateVirtualItemOrderInGroup() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
142 | { |
||
143 | static::$xsollaClient->UpdateVirtualItemOrderInGroup([ |
||
144 | 'project_id' => static::$projectId, |
||
145 | 'request' => [ |
||
146 | 'group_id' => static::$virtualItemsGroupId, |
||
147 | 'virtual_items' => [static::$virtualItemSku], |
||
148 | ], |
||
149 | ]); |
||
150 | static::assertTrue(true); |
||
151 | } |
||
152 | |||
153 | /** |
||
154 | * @depends testUpdateVirtualItemOrderInGroup |
||
155 | */ |
||
156 | public function testDeleteVirtualItem() |
||
157 | { |
||
158 | static::$xsollaClient->DeleteVirtualItem([ |
||
159 | 'project_id' => static::$projectId, |
||
160 | 'item_id' => static::$virtualItemId, |
||
161 | ]); |
||
162 | static::assertTrue(true); |
||
163 | } |
||
164 | |||
165 | /** |
||
166 | * @depends testDeleteVirtualItem |
||
167 | */ |
||
168 | public function testDeleteVirtualItemsGroup() |
||
169 | { |
||
170 | static::$xsollaClient->DeleteVirtualItemsGroup([ |
||
171 | 'project_id' => static::$projectId, |
||
172 | 'group_id' => static::$virtualItemsGroupId, |
||
173 | ]); |
||
174 | static::assertTrue(true); |
||
175 | } |
||
176 | } |
||
177 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.