| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | namespace Xsolla\SDK\Tests\Integration\API; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * @group api | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  | class StorefrontTest 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 testGetStorefrontVirtualCurrency() | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |         $response = $this->xsollaClient->GetStorefrontVirtualCurrency( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 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 testGetStorefrontVirtualGroups() | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |         $response = $this->xsollaClient->GetStorefrontVirtualGroups( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 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 testGetStorefrontVirtualItems() | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |         $response = $this->xsollaClient->GetStorefrontVirtualItems( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 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 testGetStorefrontSubscriptions() | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |         $response = $this->xsollaClient->GetStorefrontSubscriptions( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 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 testGetStorefrontBonus() | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  |         $response = $this->xsollaClient->GetStorefrontBonus( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 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 |  |  |  | 
            
                        
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.