CommitMsgTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 10
c 0
b 0
f 0
dl 0
loc 23
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testExecute() 0 16 1
1
<?php
2
3
/**
4
 * This file is part of CaptainHook
5
 *
6
 * (c) Sebastian Feldmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CaptainHook\App\Console\Command\Hook;
13
14
use CaptainHook\App\Console\Runtime\Resolver;
15
use CaptainHook\App\Git\DummyRepo;
16
use CaptainHook\App\Hooks;
17
use Symfony\Component\Console\Input\ArrayInput;
18
use Symfony\Component\Console\Output\NullOutput;
19
use PHPUnit\Framework\TestCase;
20
21
class CommitMsgTest extends TestCase
22
{
23
    /**
24
     * Tests CommitMsg::run
25
     *
26
     * @throws \Exception
27
     */
28
    public function testExecute(): void
29
    {
30
        $repo   = new DummyRepo();
31
        $output = new NullOutput();
32
        $input  = new ArrayInput(
33
            [
34
                '--configuration'       => CH_PATH_FILES . '/config/valid.json',
35
                '--git-directory'       => $repo->getGitDir(),
36
                Hooks::ARG_MESSAGE_FILE => CH_PATH_FILES . '/git/message/valid.txt'
37
            ]
38
        );
39
40
        $cmd = new CommitMsg(new Resolver());
41
        $cmd->run($input, $output);
42
43
        $this->assertTrue(true);
44
    }
45
}
46