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

FixedConfigTest::testHeartbeat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
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
}