Completed
Pull Request — 3.1 (#348)
by Piotr
07:35
created

BooleanSpec::it_ignore_empty_values()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace spec\FSi\Bundle\AdminBundle\Display\Property\Formatter;
4
5
use PhpSpec\ObjectBehavior;
6
use Prophecy\Argument;
7
8
class BooleanSpec extends ObjectBehavior
9
{
10
    function let()
11
    {
12
        $this->beConstructedWith('yes', 'no');
13
    }
14
15
    function it_ignore_empty_values()
16
    {
17
        $this->format(0)->shouldReturn(0);
18
        $this->format(null)->shouldReturn(null);
19
        $this->format([])->shouldReturn([]);
20
    }
21
22
    function it_decorate_value()
23
    {
24
        $this->format(true)->shouldReturn('yes');
25
        $this->format(false)->shouldReturn('no');
26
    }
27
}
28