CliHelper   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 9

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 9
dl 0
loc 59
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A collectionBuilder() 0 8 1
A seeDirFound() 0 4 2
A _before() 0 8 1
A _after() 0 5 1
1
<?php
2
namespace Codeception\Module;
3
4
use Robo\Robo;
5
use Robo\Collection\CollectionBuilder;
6
use Robo\Task\ValueProviderTask;
7
8
use Symfony\Component\Console\Output\ConsoleOutput;
9
10
use League\Container\ContainerAwareInterface;
11
use League\Container\ContainerAwareTrait;
12
13
class CliHelper extends \Codeception\Module implements ContainerAwareInterface
14
{
15
    use ContainerAwareTrait;
16
    use SeeInOutputTrait;
17
18
    use \Robo\LoadAllTasks {
19
        task as public;
20
        taskExec as public;
21
        taskExecStack as public;
22
        taskWriteToFile as public;
23
        taskReplaceInFile as public;
24
        taskConcat as public;
25
        taskTmpFile as public;
26
        taskCleanDir as public;
27
        taskCopyDir as public;
28
        taskGenTask as public;
29
        taskDeleteDir as public;
30
        taskFlattenDir as public;
31
        taskFilesystemStack as public;
32
        taskForEach as public;
33
        taskTmpDir as public;
34
        taskMinify as public;
35
        _copyDir as public shortcutCopyDir;
36
        _mirrorDir as public shortcutMirrorDir;
37
        _tmpDir as public shortcutTmpDir;
38
        taskPack as public;
39
        taskExtract as public;
40
        setBuilder as public;
41
    }
42
43
    public function collectionBuilder()
44
    {
45
        $tasks = new CliHelperTasks();
46
        $builder = CollectionBuilder::create($this->getContainer(), $tasks);
47
        $tasks->setBuilder($builder);
48
49
        return $builder;
50
    }
51
52
    public function seeDirFound($dir)
53
    {
54
        $this->assertTrue(is_dir($dir) && file_exists($dir), "Directory does not exist");
55
    }
56
57
    public function _before(\Codeception\TestCase $test) {
58
        $container = new \League\Container\Container();
59
        $this->initSeeInOutputTrait($container);
60
        Robo::setContainer($container);
61
        $this->setContainer($container);
62
63
        $this->getModule('Filesystem')->copyDir(codecept_data_dir().'claypit', codecept_data_dir().'sandbox');
64
    }
65
66
    public function _after(\Codeception\TestCase $test) {
67
        $this->getModule('Filesystem')->deleteDir(codecept_data_dir().'sandbox');
68
        $this->getContainer()->add('output', new ConsoleOutput());
69
        chdir(codecept_root_dir());
70
    }
71
}
72