Completed
Push — master ( 21fef4...f7e2e6 )
by Tomasz
05:34
created

FixedConfigTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 23
wmc 3
lcom 1
cbo 3
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreate() 0 6 1
A testCreateWithLogger() 0 5 1
A testHeartbeat() 0 7 1
1
<?php
2
3
namespace Gendoria\CruftFlake\Config;
4
5
use PHPUnit_Framework_TestCase;
6
use Psr\Log\NullLogger;
7
8
/**
9
 * Description of LocalClientTest
10
 *
11
 * @author Tomasz Struczyński <[email protected]>
12
 */
13
class FixedConfigTest extends PHPUnit_Framework_TestCase
14
{
15
    public function testCreate()
16
    {
17
        $config = new FixedConfig(1);
18
        $config->setLogger(new NullLogger());
19
        $this->assertEquals(1, $config->getMachine());
20
    }
21
    
22
    public function testCreateWithLogger()
23
    {
24
        $config = new FixedConfig(1, new NullLogger());
25
        $this->assertEquals(1, $config->getMachine());
26
    }
27
    
28
    public function testHeartbeat()
29
    {
30
        $config = new FixedConfig(10);
31
        $this->assertEquals(10, $config->getMachine());
32
        $this->assertFalse($config->heartbeat());
33
        $this->assertEquals(10, $config->getMachine());
34
    }
35
}