AppTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 36
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A it_gets_details_for_an_app_by_id() 0 11 1
A it_gets_a_list_of_all_apps() 0 7 1
A checkClasses() 0 8 1
1
<?php
2
3
require_once('BaseTester.php');
4
5
/** @group App */
6
class AppTest extends BaseTester {
0 ignored issues
show
Bug introduced by
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: artisan, be, call, seed
Loading history...
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('Illuminate\Support\Collection', $detail->developers);
37
        $this->assertInstanceOf('Illuminate\Support\Collection', $detail->publishers);
38
        $this->assertInstanceOf('Illuminate\Support\Collection', $detail->categories);
39
        $this->assertInstanceOf('Illuminate\Support\Collection', $detail->genres);
40
    }
41
}
42