Passed
Push — master ( 813fe9...62056b )
by Sebastian
06:01
created

ConfigurationTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 4
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testExecute() 0 14 1
1
<?php
2
/**
3
 * This file is part of CaptainHook.
4
 *
5
 * (c) Sebastian Feldmann <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace CaptainHook\App\Console\Command;
11
12
use CaptainHook\App\Console\IO\NullIO;
13
use CaptainHook\App\Git\DummyRepo;
14
use Symfony\Component\Console\Input\ArrayInput;
15
use Symfony\Component\Console\Tests\Fixtures\DummyOutput;
16
17
class ConfigurationTest extends \PHPUnit_Framework_TestCase
18
{
19
    /**
20
     * Tests Configure::run
21
     */
22
    public function testExecute()
23
    {
24
        $config    = sys_get_temp_dir() . DIRECTORY_SEPARATOR . md5(mt_rand(0, 9999)) . '.json';
25
        $configure = new Configuration();
26
        $output    = new DummyOutput();
27
        $input     = new ArrayInput(['--configuration' => $config]);
28
29
        $configure->setIO(new NullIO());
30
        $configure->run($input, $output);
31
32
        $this->assertTrue(file_exists($config));
33
34
        unlink($config);
35
    }
36
}
37