Conditions | 1 |
Paths | 1 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function testIsFeatureMatchFilter() |
||
11 | { |
||
12 | $description = <<<NAR |
||
13 | In order to be able to read news in my own language |
||
14 | As a french user |
||
15 | I need to be able to switch website language to french |
||
16 | NAR; |
||
17 | $feature = new FeatureNode(null, $description, array(), null, array(), null, null, null, 1); |
||
18 | |||
19 | $filter = new NarrativeFilter('/as (?:a|an) french user/'); |
||
20 | $this->assertFalse($filter->isFeatureMatch($feature)); |
||
21 | |||
22 | $filter = new NarrativeFilter('/as (?:a|an) french user/i'); |
||
23 | $this->assertTrue($filter->isFeatureMatch($feature)); |
||
24 | |||
25 | $filter = new NarrativeFilter('/french .*/'); |
||
26 | $this->assertTrue($filter->isFeatureMatch($feature)); |
||
27 | |||
28 | $filter = new NarrativeFilter('/^french/'); |
||
29 | $this->assertFalse($filter->isFeatureMatch($feature)); |
||
30 | |||
31 | $filter = new NarrativeFilter('/user$/'); |
||
32 | $this->assertFalse($filter->isFeatureMatch($feature)); |
||
33 | } |
||
34 | } |
||
35 |