1 | <?php |
||
23 | class LineFilter implements FilterInterface |
||
24 | { |
||
25 | protected $filterLine; |
||
26 | |||
27 | /** |
||
28 | * Initializes filter. |
||
29 | * |
||
30 | * @param string $filterLine Line of the scenario to filter on |
||
31 | */ |
||
32 | 4 | public function __construct($filterLine) |
|
33 | { |
||
34 | 4 | $this->filterLine = intval($filterLine); |
|
35 | 4 | } |
|
36 | |||
37 | /** |
||
38 | * Checks if Feature matches specified filter. |
||
39 | * |
||
40 | * @param FeatureNode $feature Feature instance |
||
41 | * |
||
42 | * @return Boolean |
||
43 | */ |
||
44 | 1 | public function isFeatureMatch(FeatureNode $feature) |
|
45 | { |
||
46 | 1 | return $this->filterLine === $feature->getLine(); |
|
47 | } |
||
48 | |||
49 | /** |
||
50 | * Checks if scenario or outline matches specified filter. |
||
51 | * |
||
52 | * @param ScenarioInterface $scenario Scenario or Outline node instance |
||
53 | * |
||
54 | * @return Boolean |
||
55 | */ |
||
56 | 3 | public function isScenarioMatch(ScenarioInterface $scenario) |
|
69 | |||
70 | /** |
||
71 | * Filters feature according to the filter and returns new one. |
||
72 | * |
||
73 | * @param FeatureNode $feature |
||
74 | * |
||
75 | * @return FeatureNode |
||
76 | */ |
||
77 | 2 | public function filterFeature(FeatureNode $feature) |
|
122 | } |
||
123 |