-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathAppTest.php
41 lines (32 loc) · 1.19 KB
/
AppTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
require_once('BaseTester.php');
/** @group App */
class AppTest extends BaseTester {
/** @test */
public function it_gets_details_for_an_app_by_id()
{
$details = $this->steamClient->app()->appDetails($this->appId);
$this->assertCount(1, $details);
$detail = $details->first();
$this->checkAppProperties($detail);
$this->checkClasses($detail);
}
/** @test */
public function it_gets_a_list_of_all_apps()
{
$apps = $this->steamClient->app()->GetAppList();
$this->assertGreaterThan(0, $apps);
$this->assertObjectHasProperties(['appid', 'name'], $apps[0]);
}
/**
* @param $detail
*/
private function checkClasses($detail): void
{
$this->assertInstanceOf(\Syntax\SteamApi\Containers\App::class, $detail);
$this->assertInstanceOf(\Illuminate\Support\Collection::class, $detail->developers);
$this->assertInstanceOf(\Illuminate\Support\Collection::class, $detail->publishers);
$this->assertInstanceOf(\Illuminate\Support\Collection::class, $detail->categories);
$this->assertInstanceOf(\Illuminate\Support\Collection::class, $detail->genres);
}
}