Completed
Push — master ( 64fdd0...71c274 )
by Vitaliy
11s
created

PaystationTest   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 80
Duplicated Lines 76.25 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 6
c 1
b 0
f 1
lcom 1
cbo 2
dl 61
loc 80
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 7 1
A testGetPaystationVirtualCurrency() 12 12 1
A testGetPaystationVirtualGroups() 12 12 1
A testGetPaystationVirtualItems() 13 13 1
A testGetPaystationSubscriptions() 12 12 1
A testGetPaystationBonus() 12 12 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace Xsolla\SDK\Tests\Integration\API;
4
5
/**
6
 * @group api
7
 */
8
class PaystationTest extends AbstractAPITest
9
{
10
    protected $currency;
11
    protected $language;
12
    protected $userId;
13
14
    public function setUp()
15
    {
16
        parent::setUp();
17
        $this->currency = 'USD';
18
        $this->language = 'en';
19
        $this->userId = 'test';
20
    }
21
22 View Code Duplication
    public function testGetPaystationVirtualCurrency()
0 ignored issues
show
Duplication introduced by
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...
23
    {
24
        $response = $this->xsollaClient->GetPaystationVirtualCurrency(
25
            array(
26
                'project_id' => $this->projectId,
27
                'user_id' => $this->userId,
28
                'language' => $this->language,
29
                'currency' => $this->currency,
30
            )
31
        );
32
        static::assertInternalType('array', $response);
33
    }
34
35 View Code Duplication
    public function testGetPaystationVirtualGroups()
0 ignored issues
show
Duplication introduced by
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...
36
    {
37
        $response = $this->xsollaClient->GetPaystationVirtualGroups(
38
            array(
39
                'project_id' => $this->projectId,
40
                'user_id' => $this->userId,
41
                'language' => $this->language,
42
                'currency' => $this->currency,
43
            )
44
        );
45
        static::assertInternalType('array', $response);
46
    }
47
48 View Code Duplication
    public function testGetPaystationVirtualItems()
0 ignored issues
show
Duplication introduced by
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...
49
    {
50
        $response = $this->xsollaClient->GetPaystationVirtualItems(
51
            array(
52
                'project_id' => $this->projectId,
53
                'user_id' => $this->userId,
54
                'language' => $this->language,
55
                'currency' => $this->currency,
56
                'group_id' => 7,
57
            )
58
        );
59
        static::assertInternalType('array', $response);
60
    }
61
62 View Code Duplication
    public function testGetPaystationSubscriptions()
0 ignored issues
show
Duplication introduced by
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...
63
    {
64
        $response = $this->xsollaClient->GetPaystationSubscriptions(
65
            array(
66
                'project_id' => $this->projectId,
67
                'user_id' => $this->userId,
68
                'language' => $this->language,
69
                'currency' => $this->currency,
70
            )
71
        );
72
        static::assertInternalType('array', $response);
73
    }
74
75 View Code Duplication
    public function testGetPaystationBonus()
0 ignored issues
show
Duplication introduced by
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...
76
    {
77
        $response = $this->xsollaClient->GetPaystationBonus(
78
            array(
79
                'project_id' => $this->projectId,
80
                'user_id' => $this->userId,
81
                'language' => $this->language,
82
                'currency' => $this->currency,
83
            )
84
        );
85
        static::assertInternalType('array', $response);
86
    }
87
}
88