Completed
Pull Request — master (#177)
by Ciaran
11:01
created

KeywordTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 34
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A it_parses_a_keyword() 0 8 1
A it_parses_a_keyword_followed_by_colon() 0 8 1
A it_allows_prefixed_whitespace() 0 8 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Tests\Behat\Gherkin\Parsica;
5
6
use PHPUnit\Framework\TestCase;
7
use Verraes\Parsica\PHPUnit\ParserAssertions;
8
use function Behat\Gherkin\Parsica\keyword;
9
10
class KeywordTest extends TestCase
11
{
12
    use ParserAssertions;
13
14
    /** @test */
15
    function it_parses_a_keyword()
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
        $input = 'Foo ';
18
        $expected = 'Foo';
19
        $parser = keyword('Foo', false);
20
21
        $this->assertParses($input, $parser, $expected);
0 ignored issues
show
Bug introduced by
The method assertParses() does not exist on Tests\Behat\Gherkin\Parsica\KeywordTest. Did you maybe mean assertParse()?

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...
22
    }
23
24
    /** @test */
25
    function it_parses_a_keyword_followed_by_colon()
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...
26
    {
27
        $input = 'Foo:';
28
        $expected = 'Foo';
29
        $parser = keyword('Foo', true);
30
31
        $this->assertParses($input, $parser, $expected);
0 ignored issues
show
Bug introduced by
The method assertParses() does not exist on Tests\Behat\Gherkin\Parsica\KeywordTest. Did you maybe mean assertParse()?

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...
32
    }
33
34
    /** @test */
35
    function it_allows_prefixed_whitespace()
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...
36
    {
37
        $input = "\t   Foo ";
38
        $expected = 'Foo';
39
        $parser = keyword('Foo', false);
40
41
        $this->assertParses($input, $parser, $expected);
0 ignored issues
show
Bug introduced by
The method assertParses() does not exist on Tests\Behat\Gherkin\Parsica\KeywordTest. Did you maybe mean assertParse()?

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...
42
    }
43
}
44