Completed
Push — Laravel4 ( 02d48b...8c5149 )
by Travis
03:47 queued 03:02
created

AppTest::checkClasses()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 8
rs 9.4285
cc 1
eloc 6
nc 1
nop 1
1
<?php
2
3
require_once('BaseTester.php');
4
5
/** @group App */
6
class AppTest extends BaseTester {
7
8
    /** @test */
9
    public function it_gets_details_for_an_app_by_id()
10
    {
11
        $details = $this->steamClient->app()->appDetails($this->appId);
12
13
        $this->assertCount(1, $details);
14
15
        $detail = $details->first();
16
17
        $this->checkAppProperties($detail);
18
        $this->checkClasses($detail);
19
    }
20
21
    /** @test */
22
    public function it_gets_a_list_of_all_apps()
23
    {
24
        $apps = $this->steamClient->app()->GetAppList();
25
26
        $this->assertGreaterThan(0, $apps);
27
        $this->assertObjectHasAttributes(['appid', 'name'], $apps[0]);
28
    }
29
30
    /**
31
     * @param $detail
32
     */
33
    private function checkClasses($detail)
34
    {
35
        $this->assertInstanceOf('Syntax\SteamApi\Containers\App', $detail);
36
        $this->assertInstanceOf('Syntax\SteamApi\Collection', $detail->developers);
37
        $this->assertInstanceOf('Syntax\SteamApi\Collection', $detail->publishers);
38
        $this->assertInstanceOf('Syntax\SteamApi\Collection', $detail->categories);
39
        $this->assertInstanceOf('Syntax\SteamApi\Collection', $detail->genres);
40
    }
41
}