AAGoogleClientServiceTest::testCreation()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 9.4285
1
<?php
2
3
class AAGoogleClientServiceTest 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 = true;
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', Director::baseFolder() . DIRECTORY_SEPARATOR . 'google-api/tests/fixtures/test.json');
28
        $client = new GoogleClientService();
29
        $this->assertInstanceOf(Google_Client::class, $client->getClient());
30
    }
31
}
32