WriterStepSpec::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 Port\Writer;
7
use PhpSpec\ObjectBehavior;
8
9
class WriterStepSpec extends ObjectBehavior
10
{
11
    function let(Writer $writer)
12
    {
13
        $this->beConstructedWith($writer);
14
    }
15
16
    function it_is_initializable()
17
    {
18
        $this->shouldHaveType('Port\Steps\Step\WriterStep');
19
    }
20
21
    function it_is_a_step()
22
    {
23
        $this->shouldHaveType('Port\Steps\Step');
24
    }
25
26 View Code Duplication
    function it_processes_an_item(Writer $writer, Step $step)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
27
    {
28
        $next = function() {};
29
        $item = [];
30
        $step->process($item, $next)->willReturn(true);
31
        $writer->writeItem($item)->shouldBeCalled();
32
33
        $this->process(
0 ignored issues
show
Bug introduced by
The method process() does not exist on spec\Port\Steps\Step\WriterStepSpec. 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...
34
            $item,
35
            function($item) use ($step, $next) {
36
                return $step->process($item, $next);
37
            }
38
        );
39
    }
40
}
41