Completed
Push — master ( a33641...7233dc )
by San
02:42
created

BaseContext::assertCount()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 1
nop 3
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
     * en
20
     * @transform /^(0|[1-9]\d*)(?:st|nd|rd|th)?$/
21
     *
22
     * fr
23
     * @transform /^(0|[1-9]\d*)(?:ier|er|e|ème)?$/
24
     *
25
     * pt
26
     * @transform /^(0|[1-9]\d*)º?$/
27
     */
28
    public function castToInt($count)
29
    {
30
        return intval($count);
31
    }
32
33
    protected function getMinkContext()
34
    {
35
        $context = new \Behat\MinkExtension\Context\MinkContext();
36
        $context->setMink($this->getMink());
37
        $context->setMinkParameters($this->getMinkParameters());
38
39
        return $context;
40
    }
41
}
42