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

FeatureTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A it_parses_a_empty_feature() 0 10 1
A it_parses_a_feature_with_a_title() 0 8 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Tests\Behat\Gherkin\Parsica;
5
6
use Behat\Gherkin\Node\FeatureNode;
7
use PHPUnit\Framework\TestCase;
8
use Verraes\Parsica\PHPUnit\ParserAssertions;
9
use function Behat\Gherkin\Parsica\feature;
10
11
class FeatureTest extends TestCase
12
{
13
    use ParserAssertions;
14
15
    /** @test */
16
    function it_parses_a_empty_feature()
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...
17
    {
18
        $input = 'Feature:';
19
20
        $expected = new FeatureNode('', '', [], null, [], 'Feature', 'en', null, 1);
21
22
        $parser = feature();
23
24
        $this->assertParses($input, $parser, $expected);
0 ignored issues
show
Bug introduced by
The method assertParses() does not exist on Tests\Behat\Gherkin\Parsica\FeatureTest. 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...
25
    }
26
27
    /** @test */
28
    public function it_parses_a_feature_with_a_title()
29
    {
30
        $input = 'Feature: This is a really cool feature';
31
        $expected = new FeatureNode('This is a really cool feature', '',[],null,[], 'Feature','en',null,1);
32
33
        $parser = feature();
34
        $this->assertParses($input, $parser, $expected);
0 ignored issues
show
Bug introduced by
The method assertParses() does not exist on Tests\Behat\Gherkin\Parsica\FeatureTest. 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...
35
    }
36
}
37