Completed
Push — 3.x ( 377254...28590d )
by San
02:50
created

BaseContext::getMinkContext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Behatch\Context;
4
5
use Behat\Behat\Context\TranslatableContext;
6
use Behat\MinkExtension\Context\RawMinkContext;
7
8
abstract class BaseContext extends RawMinkContext implements TranslatableContext
9
{
10
    use \Behatch\Html;
11
    use \Behatch\Asserter;
12
13
    public static function getTranslationResources()
14
    {
15
        return glob(__DIR__ . '/../../i18n/*.xliff');
16
    }
17
18
    /**
19
     * @transform /^(0|[1-9]\d*)(?:st|nd|rd|th)?$/
20
     */
21
    public function castToInt($count)
22
    {
23
        return intval($count);
24
    }
25
26
    protected function getMinkContext()
27
    {
28
        $context = new \Behat\MinkExtension\Context\MinkContext();
29
        $context->setMink($this->getMink());
30
        $context->setMinkParameters($this->getMinkParameters());
31
32
        return $context;
33
    }
34
}
35