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

GoogleClientServiceTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreation() 0 4 1
A testNoAnalyticsKey() 0 4 1
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