Phpunit::phpunit()   C
last analyzed

Complexity

Conditions 9
Paths 5

Size

Total Lines 23
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 90

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 5.8541
c 0
b 0
f 0
ccs 0
cts 16
cp 0
cc 9
eloc 10
nc 5
nop 1
crap 90
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