Issues (94)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

tests/Integration/API/VirtualItemsTest.php (9 issues)

Upgrade to new PHP Analysis Engine

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
Deprecated Code introduced by
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.

Loading history...
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
Deprecated Code introduced by
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.

Loading history...
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.

Loading history...
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
Deprecated Code introduced by
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.

Loading history...
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.

Loading history...
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
Deprecated Code introduced by
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.

Loading history...
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.

Loading history...
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
Deprecated Code introduced by
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.

Loading history...
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.

Loading history...
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