Completed
Push — master ( 90e450...444125 )
by Alfred
02:45
created

RunTest::getClassFileNameAndPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
4
namespace GD;
5
6
use Silly\Edition\Pimple\Application;
7
8
class RunTest extends BaseGherkinToDusk
9
{
10
    protected $path;
11
12
    /**
13
     * @var string
14
     */
15
    protected $class_file_name_and_path;
16
    
17
18
    public function handleDomain($path)
19
    {
20
21
        $this->path = $path;
22
        //Is DIR?
23
        
24
        //Is File
25
        $this->runTestFromFile();
26
    }
27
28
    private function setClassFileNameAndPath($class_file_name_and_path = null)
29
    {
30
31
        if (!$class_file_name_and_path) {
32
            $file_name = $this->app->getContainer()['filesystem']->name($this->path);
33
34
            $class_file_name_and_path = sprintf("tests/Unit/%sTest.php", camel_case($file_name));
35
        }
36
37
        $this->class_file_name_and_path = $class_file_name_and_path;
38
39
        return $this;
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getClassFileNameAndPath()
46
    {
47
        return $this->class_file_name_and_path;
48
    }
49
50
    private function runTestFromFile()
51
    {
52
        $this->setClassFileNameAndPath();
53
    }
54
}
55