Completed
Pull Request — master (#112)
by Christophe
02:45
created

PathsFilterTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 5
Bugs 0 Features 1
Metric Value
c 5
b 0
f 1
dl 0
loc 22
wmc 1
lcom 0
cbo 3
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testIsFeatureMatchFilter() 0 19 1
1
<?php
2
3
namespace Tests\Behat\Gherkin\Filter;
4
5
use Behat\Gherkin\Filter\PathsFilter;
6
use Behat\Gherkin\Node\FeatureNode;
7
8
class PathsFilterTest extends FilterTest
9
{
10
    public function testIsFeatureMatchFilter()
11
    {
12
        $feature = new FeatureNode(null, null, array(), null, array(), null, null, __FILE__, 1);
13
14
        $filter = new PathsFilter(array(__DIR__));
15
        $this->assertTrue($filter->isFeatureMatch($feature));
16
17
        $filter = new PathsFilter(array('/abc', '/def', dirname(__DIR__)));
18
        $this->assertTrue($filter->isFeatureMatch($feature));
19
20
        $filter = new PathsFilter(array('/abc', '/def', __DIR__));
21
        $this->assertTrue($filter->isFeatureMatch($feature));
22
23
        $filter = new PathsFilter(array('/abc', __DIR__, '/def'));
24
        $this->assertTrue($filter->isFeatureMatch($feature));
25
26
        $filter = new PathsFilter(array('/abc', '/def', '/wrong/path'));
27
        $this->assertFalse($filter->isFeatureMatch($feature));
28
    }
29
}
30