Phpunit   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 10
lcom 0
cbo 2
dl 0
loc 41
rs 10
c 0
b 0
f 0
ccs 0
cts 20
cp 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
C phpunit() 0 23 9
1
<?php
2
3
namespace Venus\src\Batch\Controller;
4
5
use \Venus\src\Batch\common\Controller as Controller;
6
7
class Phpunit extends Controller
8
{
9
    /**
10
     * Constructs a test case with the given name.
11
     *
12
     */
13
    public function __construct()
14
    {
15
        parent::__construct();
16
    }
17
18
    /**
19
     * new method to launch a web server
20
     * @param array $options
21
     * @tutorial php bin/console server:run
22
     *           php bin/console server:run -a 192.168.0.1:8000
23
     */
24
    public function phpunit(array $options = array())
0 ignored issues
show
Unused Code introduced by
The parameter $options is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
    {
26
        ob_get_clean();
27
28
        $files = scandir(__DIR__.'/../../../../tests');
29
30
        foreach ($files as $one) {
31
32
            if (is_dir(__DIR__.'/../../../../tests/'.$one) && $one != '..' && $one != '.') {
33
34
                $controllerFiles = scandir(__DIR__.'/../../../../tests'.'/'.$one.'/app/Controller');
35
36
                foreach ($controllerFiles as $oneController) {
37
38
                    if (is_file(__DIR__.'/../../../../tests/'.$one.'/app/Controller/' . $oneController) && $oneController != '..' && $oneController != '.') {
39
40
                        $unitTest = new \PHPUnit_TextUI_Command;
41
                        $unitTest->run([__DIR__.'/../../../../tests/'.$one.'/app/Controller/' . $oneController]);
42
                    }
43
                }
44
            }
45
        }
46
    }
47
}
48