Test Failed
Push — master ( 22d245...e46311 )
by Hannes
02:55
created

RegexpSpec::it_can_match_with_custom_delimiter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace spec\hanneskod\readmetester\Utils;
6
7
use hanneskod\readmetester\Utils\Regexp;
8
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...
9
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...
10
11
class RegexpSpec extends ObjectBehavior
12
{
13
    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...
14
    {
15
        $this->beConstructedWith('');
16
        $this->shouldHaveType(Regexp::CLASS);
0 ignored issues
show
Bug introduced by
The constant hanneskod\readmetester\Utils\Regexp::CLASS was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
17
    }
18
19
    function it_can_match()
20
    {
21
        $this->beConstructedWith('/test/');
22
        $this->isMatch('this test should match')->shouldReturn(true);
23
    }
24
25
    function it_can_fail_match()
26
    {
27
        $this->beConstructedWith('foo');
28
        $this->isMatch('bar')->shouldReturn(false);
29
    }
30
31
    function it_can_match_with_custom_delimiter()
32
    {
33
        $this->beConstructedWith('#delimiter#');
34
        $this->isMatch('a different delimiter')->shouldReturn(true);
35
    }
36
37
    function it_can_make_regexp()
38
    {
39
        $this->beConstructedWith('test');
40
        $this->isMatch('test')->shouldReturn(true);
41
    }
42
43
    function it_can_return_internal_regexp()
44
    {
45
        $this->beConstructedWith('foo');
46
        $this->getRegexp()->shouldReturn('/^foo$/');
47
    }
48
}
49