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

PathsFilterTest::testIsFeatureMatchFilter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 1
Metric Value
c 3
b 0
f 1
dl 0
loc 19
rs 9.4285
cc 1
eloc 12
nc 1
nop 0
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