PrepareCommitMsgTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testExecute() 0 17 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 PHPUnit\Framework\TestCase;
19
use Symfony\Component\Console\Output\NullOutput;
20
21
class PrepareCommitMsgTest extends TestCase
22
{
23
    /**
24
     * Tests PrepareCommitMsg::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
                Hooks::ARG_MODE         => 'message'
38
            ]
39
        );
40
41
        $cmd = new PrepareCommitMsg(new Resolver());
42
        $cmd->run($input, $output);
43
44
        $this->assertTrue(true);
45
    }
46
}
47