MorsecodeSpec   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 27
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 4 1
A it_can_encode() 0 4 1
A it_can_decode() 0 4 1
A it_should_encode_if_constructed_with_value() 0 4 1
A it_should_decode_if_constructed_with_value() 0 4 1
1
<?php
2
3
namespace spec\johnnymast\Morsecode;
4
5
use PhpSpec\ObjectBehavior;
6
use johnnymast\Morsecode\Morsecode;
7
8
class MorsecodeSpec extends ObjectBehavior
9
{
10
    function it_is_initializable()
11
    {
12
        $this->shouldHaveType(Morsecode::class);
13
    }
14
15
    function it_can_encode()
16
    {
17
        $this->encode('sos')->shouldReturn('... --- ...');
18
    }
19
20
    function it_can_decode()
21
    {
22
        $this->decode('... --- ...')->shouldReturn('sos');
23
    }
24
25
    function it_should_encode_if_constructed_with_value() {
26
        $this->beConstructedWith('sos');
27
        $this->encode()->shouldReturn('... --- ...');
28
    }
29
30
    function it_should_decode_if_constructed_with_value() {
31
        $this->beConstructedWith('... --- ...');
32
        $this->decode()->shouldReturn('sos');
33
    }
34
}
35