1 | <?php |
||
7 | class BaseTester extends TestCase { |
||
|
|||
8 | |||
9 | protected $id32 = 'STEAM_1:1:31085444'; |
||
10 | |||
11 | protected $id64 = 76561198022436617; |
||
12 | |||
13 | protected $id3 = '[U:1:62170889]'; |
||
14 | |||
15 | protected $altId64 = 76561197979958413; |
||
16 | |||
17 | protected $appId = 620; |
||
18 | |||
19 | protected $packageId = 32848; |
||
20 | |||
21 | protected $itemAppId = 440; |
||
22 | |||
23 | protected $groupId = 103582791429521412; |
||
24 | |||
25 | protected $groupName = 'Valve'; |
||
26 | |||
27 | protected $steamClient; |
||
28 | |||
29 | protected function setUp(): void |
||
43 | |||
44 | /** @test */ |
||
45 | public function empty_test() |
||
49 | |||
50 | protected function assertObjectHasAttributes($attributes, $object) |
||
56 | |||
57 | protected function checkSteamIdsProperties($steamId) |
||
64 | |||
65 | protected function checkPlayerProperties($friendsList) |
||
89 | |||
90 | protected function checkAchievementProperties($achievement) |
||
97 | |||
98 | protected function checkAppProperties($app) |
||
104 | |||
105 | protected function checkPackageProperties($package) |
||
109 | |||
110 | protected function checkGroupProperties($group) |
||
117 | |||
118 | /** |
||
119 | * @param $item |
||
120 | */ |
||
121 | protected function checkItemProperties($item) |
||
122 | { |
||
123 | $attributes = ['id', 'originalId', 'level', 'quality', 'quantity']; |
||
124 | $this->assertObjectHasAttributes($attributes, $item); |
||
125 | } |
||
126 | |||
127 | /** |
||
128 | * @param $app |
||
129 | */ |
||
130 | private function checkMainAppProperties($app) |
||
131 | { |
||
132 | $attributes = [ |
||
133 | 'id', 'type', 'name', 'controllerSupport', 'description', 'about', 'fullgame', 'header', 'website', 'shortDescription' |
||
134 | ]; |
||
135 | $this->assertObjectHasAttributes($attributes, $app); |
||
136 | } |
||
137 | |||
138 | /** |
||
139 | * @param $app |
||
140 | */ |
||
141 | private function checkGeneralAppProperties($app) |
||
142 | { |
||
143 | $attributes = [ |
||
144 | 'pcRequirements', 'legal', 'developers', 'publishers', 'price', 'platforms', 'metacritic', 'categories', 'genres', 'release', 'requiredAge', 'isFree', 'supportedLanguages', 'recommendations' |
||
145 | ]; |
||
146 | $this->assertObjectHasAttributes($attributes, $app); |
||
147 | } |
||
148 | |||
149 | /** |
||
150 | * @param $app |
||
151 | */ |
||
152 | private function checkNestedAppProperties($app) |
||
153 | { |
||
154 | $this->assertObjectHasAttribute('minimum', $app->pcRequirements); |
||
155 | |||
156 | $attributes = ['currency', 'initial', 'final', 'discount_percent']; |
||
157 | $this->assertObjectHasAttributes($attributes, $app->price); |
||
158 | |||
159 | $attributes = ['windows', 'mac', 'linux']; |
||
160 | $this->assertObjectHasAttributes($attributes, $app->platforms); |
||
161 | |||
162 | $attributes = ['score', 'url']; |
||
163 | $this->assertObjectHasAttributes($attributes, $app->metacritic); |
||
164 | |||
165 | $attributes = ['total']; |
||
166 | $this->assertObjectHasAttributes($attributes, $app->recommendations); |
||
167 | |||
168 | $attributes = ['total']; |
||
169 | $this->assertObjectHasAttributes($attributes, $app->achievements); |
||
170 | } |
||
171 | |||
172 | /** |
||
173 | * @param $package |
||
174 | */ |
||
175 | private function checkNestedPackageProperties($package) |
||
176 | { |
||
177 | $attributes = ['currency', 'initial', 'final', 'discount_percent', 'individual']; |
||
178 | $this->assertObjectHasAttributes($attributes, $package->price); |
||
179 | |||
180 | $attributes = ['windows', 'mac', 'linux']; |
||
181 | $this->assertObjectHasAttributes($attributes, $package->platforms); |
||
182 | } |
||
183 | |||
184 | /** |
||
185 | * @param $group |
||
186 | */ |
||
187 | private function checkGroupMainSummaryProperties($group) |
||
195 | |||
196 | /** |
||
197 | * @param $group |
||
198 | */ |
||
199 | private function checkGroupDetailProperties($group) |
||
212 | |||
213 | /** |
||
214 | * @param $group |
||
215 | */ |
||
216 | private function checkGroupMemberDetailsProperties($group) |
||
223 | |||
224 | /** |
||
225 | * @param $group |
||
226 | */ |
||
227 | private function checkGroupMemberProperties($group) |
||
235 | |||
236 | } |
||
237 |