GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — 3.x (#89)
by Jindřich
02:37
created

ConfigTest   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 61
rs 10
c 0
b 0
f 0
wmc 9
lcom 2
cbo 2

9 Methods

Rating   Name   Duplication   Size   Complexity  
A testDefaultConfiguration() 0 9 1
A testTestModeEnabled() 0 5 1
A testTestModeDisabled() 0 5 1
A testCacheEnabled() 0 5 1
A testCacheDisabled() 0 5 1
A testCompressionEnabled() 0 5 1
A testCompressionDisabled() 0 5 1
A testBaseUrlTestModeEnabled() 0 5 1
A testBaseUrlTestModeDisabled() 0 5 1
1
<?php
2
3
namespace Skaut\Skautis\Test\Unit;
4
5
use PHPUnit\Framework\TestCase;
6
use Skaut\Skautis\Config;
7
8
class ConfigTest extends TestCase
9
{
10
11
    public function testDefaultConfiguration(): void
12
    {
13
        $config = new Config('asd123');
14
15
        $this->assertEquals('asd123', $config->getAppId());
16
        $this->assertTrue($config->isTestMode());
17
        $this->assertTrue($config->isCacheEnabled());
18
        $this->assertTrue($config->isCompressionEnabled());
19
    }
20
21
    public function testTestModeEnabled(): void
22
    {
23
        $config = new Config('asd123', Config::TEST_MODE_ENABLED);
24
        $this->assertTrue($config->isTestMode());
25
    }
26
27
    public function testTestModeDisabled(): void
28
    {
29
        $config = new Config('asd123', Config::TEST_MODE_DISABLED);
30
        $this->assertFalse($config->isTestMode());
31
    }
32
33
    public function testCacheEnabled(): void
34
    {
35
        $config = new Config('asd123', Config::TEST_MODE_ENABLED, Config::CACHE_ENABLED);
36
        $this->assertTrue($config->isCacheEnabled());
37
    }
38
39
    public function testCacheDisabled(): void
40
    {
41
        $config = new Config('asd123', Config::TEST_MODE_ENABLED, Config::CACHE_DISABLED);
42
        $this->assertFalse($config->isCacheEnabled());
43
    }
44
45
    public function testCompressionEnabled(): void
46
    {
47
        $config = new Config('asd123', Config::TEST_MODE_ENABLED, Config::CACHE_DISABLED, Config::COMPRESSION_ENABLED);
48
        $this->assertTrue( $config->isCompressionEnabled());
49
    }
50
51
    public function testCompressionDisabled(): void
52
    {
53
        $config = new Config('asd123', Config::TEST_MODE_ENABLED, Config::CACHE_DISABLED, Config::COMPRESSION_DISABLED);
54
        $this->assertFalse( $config->isCompressionEnabled());
55
    }
56
57
    public function testBaseUrlTestModeEnabled(): void
58
    {
59
        $config = new Config('sad', Config::TEST_MODE_ENABLED);
60
        $this->assertStringStartsWith('https://test', $config->getBaseUrl());
61
    }
62
63
    public function testBaseUrlTestModeDisabled(): void
64
    {
65
        $config = new Config('sad', Config::TEST_MODE_DISABLED);
66
        $this->assertStringStartsWith('https://is.', $config->getBaseUrl());
67
    }
68
}
69