Test Failed
Push — master ( a52ae2...22d245 )
by Hannes
01:58
created

ProcessorContainerSpec::it_calls_processors()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 3
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace spec\hanneskod\readmetester\Example;
6
7
use hanneskod\readmetester\Example\ProcessorContainer;
8
use hanneskod\readmetester\Example\ProcessorInterface;
9
use hanneskod\readmetester\Example\ExampleInterface;
10
use PhpSpec\ObjectBehavior;
0 ignored issues
show
Bug introduced by
The type PhpSpec\ObjectBehavior was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Prophecy\Argument;
0 ignored issues
show
Bug introduced by
The type Prophecy\Argument was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
13
class ProcessorContainerSpec extends ObjectBehavior
14
{
15
    function it_is_initializable()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
16
    {
17
        $this->shouldHaveType(ProcessorContainer::CLASS);
0 ignored issues
show
Bug introduced by
The constant hanneskod\readmetester\E...ocessorContainer::CLASS was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
18
    }
19
20
    function it_is_a_processor()
21
    {
22
        $this->shouldHaveType(ProcessorInterface::CLASS);
0 ignored issues
show
Bug introduced by
The constant hanneskod\readmetester\E...ocessorInterface::CLASS was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
23
    }
24
25
    function it_calls_processors(ProcessorInterface $proccA, ProcessorInterface $proccB, ExampleInterface $example)
26
    {
27
        $this->beConstructedWith($proccA, $proccB);
28
        $proccA->process($example)->willReturn($example)->shouldBeCalled();
0 ignored issues
show
Bug introduced by
The method willReturn() does not exist on hanneskod\readmetester\Example\ExampleInterface. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

28
        $proccA->process($example)->/** @scrutinizer ignore-call */ willReturn($example)->shouldBeCalled();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
29
        $proccB->process($example)->willReturn($example)->shouldBeCalled();
30
31
        $this->process($example)->shouldReturn($example);
32
    }
33
}
34