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

RunTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 47
ccs 0
cts 22
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A handleDomain() 0 9 1
A setClassFileNameAndPath() 0 13 2
A getClassFileNameAndPath() 0 4 1
A runTestFromFile() 0 4 1
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