Passed
Push — master ( 6fbfce...cca126 )
by Simon
01:26
created

GoogleClientServiceTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 27
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testException() 0 3 1
A testCreation() 0 5 1
1
<?php
2
3
class GoogleClientServiceTest extends SapphireTest
4
{
5
    /**
6
     * We want this process to be run in a separate process
7
     * for constant definition reasons
8
     * @var bool
9
     */
10
    protected $runTestInSeparateProcess = true;
11
    protected $preserveGlobalState = false;
12
13
14
    /**
15
     * @expectedException LogicException
16
     */
17
    public function testException()
18
    {
19
        new GoogleClientService();
20
    }
21
22
    /**
23
     * Validate it's constructed
24
     */
25
    public function testCreation()
26
    {
27
        define('SS_ANALYTICS_KEY', 'google-api/tests/fixtures/test.json');
28
        $client = new GoogleClientService();
29
        $this->assertInstanceOf(Google_Client::class, $client->getClient());
30
    }
31
}
32