ConverterStepSpec::it_is_initializable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace spec\Port\Steps\Step;
4
5
use Port\Steps\Step;
6
use PhpSpec\ObjectBehavior;
7
8
class ConverterStepSpec extends ObjectBehavior
9
{
10
    function it_is_initializable()
11
    {
12
        $this->shouldHaveType('Port\Steps\Step\ConverterStep');
13
    }
14
15
    function it_is_a_step()
16
    {
17
        $this->shouldHaveType('Port\Steps\Step');
18
    }
19
20
    function it_processes_an_item(Step $step)
21
    {
22
        $converter = function($item) {
23
            return $item;
24
        };
25
        $this->beConstructedWith([$converter]);
26
27
        $next = function() {};
28
        $item = [];
29
        $item2 = ['item2'];
30
        $step->process($item2, $next)->willReturn(true);
31
32
        $this->add(function($item) use($item2) {
0 ignored issues
show
Unused Code introduced by
The parameter $item is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
33
            return $item2;
34
        });
35
36
        $this->process(
0 ignored issues
show
Bug introduced by
The method process() does not exist on spec\Port\Steps\Step\ConverterStepSpec. Did you maybe mean it_processes_an_item()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
37
            $item,
38
            function($item) use ($step, $next) {
39
                return $step->process($item, $next);
40
            }
41
        );
42
    }
43
}
44