Completed
Pull Request — master (#112)
by Christophe
03:09
created

CachedArrayKeywordsTest::getKeywordsArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Tests\Behat\Gherkin\Keywords;
4
5
use Behat\Gherkin\Keywords\CachedArrayKeywords;
6
use Behat\Gherkin\Node\StepNode;
7
8
class CachedArrayKeywordsTest extends KeywordsTest
9
{
10
    protected function getKeywords()
11
    {
12
        return new CachedArrayKeywords(__DIR__ . '/../../../../i18n.php');
13
    }
14
15
    protected function getKeywordsArray()
16
    {
17
        return include(__DIR__ . '/../../../../i18n.php');
18
    }
19
20
    protected function getSteps($keywords, $text, &$line, $keywordType)
21
    {
22
        $steps = array();
23
        foreach (explode('|', $keywords) as $keyword) {
24
            if (false !== mb_strpos($keyword, '<')) {
25
                $keyword = mb_substr($keyword, 0, -1);
26
            }
27
28
            $steps[] = new StepNode($keyword, $text, array(), $line++, $keywordType);
29
        }
30
31
        return $steps;
32
    }
33
}
34