1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types = 1); |
4
|
|
|
|
5
|
|
|
namespace spec\hanneskod\readmetester\Example; |
6
|
|
|
|
7
|
|
|
use hanneskod\readmetester\Example\Example; |
8
|
|
|
use hanneskod\readmetester\Example\ExampleInterface; |
9
|
|
|
use hanneskod\readmetester\Expectation\ExpectationInterface; |
10
|
|
|
use hanneskod\readmetester\Name\NameInterface; |
11
|
|
|
use hanneskod\readmetester\Parser\CodeBlock; |
12
|
|
|
use PhpSpec\ObjectBehavior; |
|
|
|
|
13
|
|
|
use PhpSpec\Exception\Example\FailureException; |
|
|
|
|
14
|
|
|
use Prophecy\Argument; |
|
|
|
|
15
|
|
|
|
16
|
|
|
class ExampleSpec extends ObjectBehavior |
17
|
|
|
{ |
18
|
|
|
function let(NameInterface $name, CodeBlock $codeBlock) |
|
|
|
|
19
|
|
|
{ |
20
|
|
|
$this->beConstructedWith($name, $codeBlock); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
function it_is_initializable() |
|
|
|
|
24
|
|
|
{ |
25
|
|
|
$this->shouldHaveType(Example::CLASS); |
|
|
|
|
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
function it_is_an_example() |
29
|
|
|
{ |
30
|
|
|
$this->shouldHaveType(ExampleInterface::CLASS); |
|
|
|
|
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
function it_contains_name($name) |
34
|
|
|
{ |
35
|
|
|
$this->getName()->shouldReturn($name); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
function it_contains_code($codeBlock) |
39
|
|
|
{ |
40
|
|
|
$this->getCodeBlock()->shouldReturn($codeBlock); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
function it_defaults_to_active() |
44
|
|
|
{ |
45
|
|
|
$this->shouldBeActive(); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
function it_can_create_with_active() |
49
|
|
|
{ |
50
|
|
|
$this->withActive(false)->shouldCreateExampleThat(function ($example) { |
51
|
|
|
return $example->isActive() == false; |
52
|
|
|
}); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function getMatchers(): array |
56
|
|
|
{ |
57
|
|
|
return [ |
58
|
|
|
'createExampleThat' => function (ExampleInterface $example, callable $operation) { |
59
|
|
|
return !!$operation($example); |
60
|
|
|
} |
61
|
|
|
]; |
62
|
|
|
} |
63
|
|
|
} |
64
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths