Passed
Branch 4 (f3d551)
by Simon
03:46
created

GoogleClientServiceTest::testNoAnalyticsKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Firesphere\GoogleAPI\Tests;
4
5
use Firesphere\GoogleAPI\Services\GoogleClientService;
6
use Google_Client;
7
use SilverStripe\Dev\SapphireTest;
8
9
class GoogleClientServiceTest extends SapphireTest
10
{
11
    /**
12
     * Validate it's constructed
13
     */
14
    public function testCreation()
15
    {
16
        $client = new GoogleClientService();
17
        $this->assertInstanceOf(Google_Client::class, $client->getClient());
18
    }
19
20
    /**
21
     * @expectedException \LogicException
22
     */
23
    public function testNoAnalyticsKey()
24
    {
25
        putenv('SS_ANALYTICS_KEY');
26
        new GoogleClientService();
27
    }
28
}
29