Completed
Push — master ( fedd40...a15cc2 )
by
unknown
9s
created

tests/Integration/API/ProjectSettingsTest.php (1 issue)

Labels
Severity

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 ProjectSettingsTest extends AbstractAPITest
9
{
10
    protected $projectSettings = [
11
        'descriptor' => 'demo',
12
        'name' => [
13
            'en' => 'Demo Project for Universal Protocol',
14
        ],
15
        'url' => 'http://xsolla.com',
16
        'description' => [],
17
        'payment_url' => 'https://mygame.com/sample.universal.php',
18
        'key' => 'KEY',
19
        'return_url' => 'http://mygame.com/return.php',
20
        'user_billing_enabled' => true,
21
        'show_user_in_paystation' => true,
22
        'locale_list' => [
23
            'en',
24
        ],
25
        'components' => [
26
            'virtual_currency' => [
27
                'enabled' => true,
28
                'custom_name' => [
29
                    'en' => 'Virtual currency custom name',
30
                ],
31
            ],
32
            'items' => [
33
                'enabled' => true,
34
                'custom_name' => [
35
                    'en' => 'Items custom name',
36
                ],
37
            ],
38
            'simple_checkout' => [
39
                'enabled' => true,
40
                'custom_name' => [
41
                    'en' => 'Simple checkout custom name',
42
                ],
43
            ],
44
            'subscriptions' => [
45
                'enabled' => true,
46
                'custom_name' => [
47
                    'en' => 'Subscriptions custom name',
48
                ],
49
            ],
50
        ],
51
        'send_json_to_paystation' => false,
52
        'is_external_id_required' => false,
53
        'ipn_enabled' => true,
54
    ];
55
56
    public function testCreateProject()
57
    {
58
        static::markTestIncomplete('Delete project API method not implemented yet. We should not create new projects infinitely.');
59
    }
60
61
    public function testGetProject()
62
    {
63
        $response = static::$xsollaClient->GetProject(
64
            [
65
                'project_id' => static::$projectId,
66
            ]
67
        );
68
        static::assertInternalType('array', $response);
69
    }
70
71
    public function testUpdateProject()
72
    {
73
        $response = static::$xsollaClient->UpdateProject(
74
            [
75
                'project_id' => static::$projectId,
76
                'request' => $this->projectSettings,
77
            ]
78
        );
79
        static::assertSame(204, $response->getStatusCode());
0 ignored issues
show
The method getStatusCode cannot be called on $response (of type array).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
80
    }
81
82
    public function testListProjects()
83
    {
84
        $response = static::$xsollaClient->ListProjects();
85
        static::assertInternalType('array', $response);
86
    }
87
}
88