ProjectSettingsTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 80
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 80
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreateProject() 0 4 1
A testGetProject() 0 9 1
A testUpdateProject() 0 10 1
A testListProjects() 0 5 1
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);
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...
69
    }
70
71
    public function testUpdateProject()
72
    {
73
        static::$xsollaClient->UpdateProject(
74
            [
75
                'project_id' => static::$projectId,
76
                'request' => $this->projectSettings,
77
            ]
78
        );
79
        static::assertTrue(true);
80
    }
81
82
    public function testListProjects()
83
    {
84
        $response = static::$xsollaClient->ListProjects();
85
        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...
86
    }
87
}
88